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

Error handling in base_client.py causes AttributeError #11

Open
mkresse opened this issue Apr 21, 2021 · 0 comments
Open

Error handling in base_client.py causes AttributeError #11

mkresse opened this issue Apr 21, 2021 · 0 comments

Comments

@mkresse
Copy link

mkresse commented Apr 21, 2021

Error handling seems to be broken, as a ReadTimeout triggered by a request to orlo causes an AttributeError, because a nonexistant attribute "message" is logged:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/orloclient/base_client.py", line 39, in _get
    **req_kw_args
  File "/usr/local/lib/python3.7/dist-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='orlo.es.ecg.tools', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  ...
  File "/usr/local/lib/python3.7/dist-packages/orloclient/objects.py", line 57, in __getattr__
    self.fetch()
  File "/usr/local/lib/python3.7/dist-packages/orloclient/objects.py", line 101, in fetch
    self._data = self.client.get_release_json(self.release_id)
  File "/usr/local/lib/python3.7/dist-packages/orloclient/client.py", line 138, in get_release_json
    response = self._get(url)
  File "/usr/local/lib/python3.7/dist-packages/orloclient/base_client.py", line 51, in _get
    logger.debug(e.message)
AttributeError: 'ReadTimeout' object has no attribute 'message'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant