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.
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.https://github.com/python-social-auth/social-core/blob/95316b0914386af59d8649917c373a594f1766de/social_core/backends/base.py#L244-L245
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?
OR
In both cases we are going to receive a simple
AuthFailed
exception and we need to parse the message to identify what happened.