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

Provide a specific error for connection related issue #916

Open
sevdog opened this issue May 20, 2024 · 0 comments
Open

Provide a specific error for connection related issue #916

sevdog opened this issue May 20, 2024 · 0 comments

Comments

@sevdog
Copy link
Contributor

sevdog commented May 20, 2024

Expected behaviour

Whenever a network/connection problem it could be useful to distinguish it directly from a logic authentication error.
This could improve filtering based on exception type (ie: to handle logging in django integration).

Actual behaviour

Currently the wrapper on remote requests intercepts connection-related exceptions and transforms them into generic AuthFailed exceptions, masking the underlaying exception.

except ConnectionError as err:
raise AuthFailed(self, str(err))

Currently the only method to distinguish this case by using the __cause__ attribute which involves more code than a try-except.

What are the steps to reproduce this issue?

  1. be offline
  2. try to connect to a provider which is not hosted on your host

OR

  1. create a self-signed SSL cert for a local provider
  2. configure provider to be used without bypassing cert verification
  3. try to connect to that provider

In both cases we are going to receive a simple AuthFailed exception and we need to parse the message to identify what happened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant