Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exepction, when downloading project wihout a workspace #597

Open
jozef-budac opened this issue Jun 28, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jozef-budac
Copy link

This issue is related to this one: https://github.com/MerginMaps/server-private/issues/2381

The plugin have a problem with downloading a public project for a workspace, which is inactive. The plugin should show reasonable error like "The workplace doesn't exist, but ends with an unhandled exception

Traceback (most recent call last):

  File "/home/jozef/.local/share/QGIS/QGIS3/profiles/c/python/plugins/Mergin/mergin/client.py", line 206, in _do_request
    return self.opener.open(request)

  File "/usr/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)

  File "/usr/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(

  File "/usr/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)

  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)

  File "/usr/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)

urllib.error.HTTPError: HTTP Error 404: NOT FOUND


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/home/jozef/.local/share/QGIS/QGIS3/profiles/c/python/plugins/Mergin/sync_dialog.py", line 113, in download_start_internal
    self.job = download_project_async(self.mergin_client, self.project_name, self.target_dir)

  File "/home/jozef/.local/share/QGIS/QGIS3/profiles/c/python/plugins/Mergin/mergin/client_pull.py", line 143, in download_project_async
    latest_proj_info = mc.project_info(project_path)

  File "/home/jozef/.local/share/QGIS/QGIS3/profiles/c/python/plugins/Mergin/mergin/client.py", line 692, in project_info
    resp = self.get("/v1/project/{}".format(project_path_or_id), params)

  File "/home/jozef/.local/share/QGIS/QGIS3/profiles/c/python/plugins/Mergin/mergin/client.py", line 230, in get
    return self._do_request(request)

  File "/home/jozef/.local/share/QGIS/QGIS3/profiles/c/python/plugins/Mergin/mergin/client.py", line 195, in wrapper
    return f(self, *args)

  File "/home/jozef/.local/share/QGIS/QGIS3/profiles/c/python/plugins/Mergin/mergin/client.py", line 220, in _do_request
    raise ClientError(error_msg)

Mergin.mergin.common.ClientError: HTTP Error: 404 NOT FOUND
URL: https://app.dev.merginmaps.com/v1/project/dsadsadas/TestingPublicProject
Method: GET
Detail: Workspace doesn't exist
@jozef-budac jozef-budac added the bug Something isn't working label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant