Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Network error catching refactor #43

Open
nebbles opened this issue Dec 25, 2019 · 1 comment
Open

Network error catching refactor #43

nebbles opened this issue Dec 25, 2019 · 1 comment

Comments

@nebbles
Copy link
Owner

nebbles commented Dec 25, 2019

Network exception was thrown when checking for updates. This should be refactored to show more useful errors related to networking.

Note that this was already emergency patched in 6f426d1.

Traceback below (submitted by @PA17)

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 588, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 248, in _get_conn
    return conn or self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 826, in _new_conn
    raise SSLError("Can't connect to HTTPS URL because the SSL "
urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/nebbles/gitcommit/tags (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/gitcommit", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/gitcommit/gitcommit.py", line 396, in main
    run()
  File "/usr/local/lib/python3.7/site-packages/gitcommit/gitcommit.py", line 391, in run
    check_for_update()
  File "/usr/local/lib/python3.7/site-packages/gitcommit/updater.py", line 37, in check_for_update
    tags = get_github_tags()
  File "/usr/local/lib/python3.7/site-packages/gitcommit/updater.py", line 12, in get_github_tags
    resp = requests.get("https://api.github.com/repos/nebbles/gitcommit/tags")
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/nebbles/gitcommit/tags (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
@nebbles
Copy link
Owner Author

nebbles commented Dec 25, 2019

Needs a debug mode for showing types of errors when debug mode is enabled. Debug mode needs to be implemented by #26

nebbles added a commit that referenced this issue Dec 25, 2019
Errors are now caught within the updater. This had been patched by
wrapping around the call to updater, previously.

WIP #43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant