-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
chore(oauth): show an informative log when OAuthError is raised #3184
Conversation
This is similar to the way facebook/views.py logs an exception
_("Invalid response while obtaining request token" ' from "%s".') | ||
% get_token_prefix(self.request_token_url) | ||
_("Invalid response while obtaining request token from " + | ||
f"{get_token_prefix(self.request_token_url)}. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: Using f-strings breaks the python 3.5 build.
@@ -76,6 +78,7 @@ def login(self, request, *args, **kwargs): | |||
try: | |||
return client.get_redirect(auth_url, auth_params) | |||
except OAuthError as e: | |||
logger.exception('Error processing OAuth') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: From a logging perspective, these errors can occur in production and don't necessarily indicate exceptional situations that need direct attention. Hence, I think we need to use the regular error
level.
logger.exception('Error processing OAuth') | |
logger.error("OAuth authentication error", exc_info=True) |
Please @ykdojo , could you move on with that? I personally think it is very important to have logging of errors |
can i take up the work @pennersr ? |
@varunsaral Of course, this one seems to be abandoned... thanks. |
This is similar to the way facebook/views.py logs an exception.
This feature was requested on #2142.
The original (closed) PR: #2175
Sample log:
Submitting Pull Requests
General
Examples:
"fix(google): Fixed foobar bug"
,"feat(accounts): Added foobar feature"
.ChangeLog.rst
.AUTHORS
.Provider Specifics
In case you add a new provider:
test_settings.py::INSTALLED_APPS
anddocs/installation.rst::INSTALLED_APPS
.docs/providers.rst
.docs/overview.rst
.