-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add sentry tracking for registration endpoint/errors #9096
Add sentry tracking for registration endpoint/errors #9096
Conversation
35d91c3
to
20b4f0e
Compare
@@ -669,13 +673,13 @@ def create( | |||
return ia_account | |||
|
|||
elif 'screenname' not in response.get('values', {}): | |||
errors = '_'.join(response.get('values', {})) | |||
raise ValueError(errors) | |||
raise OLAuthenticationError('undefined_error') |
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.
Created new undefined_error
for this case. I am not familiar with the types of errors that can occur here, I was unable to find any existing errors in Sentry for insight.
ve.value = _screenname | ||
raise ve | ||
e = OLAuthenticationError('username_registered') | ||
e.value = _screenname |
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.
This value
doesn't seem to be accessed anywhere.
except ValueError: | ||
f.note = get_login_error('max_retries_exceeded') | ||
except OLAuthenticationError as e: | ||
f.note = get_login_error(e.__str__()) |
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.
e.__str__()
returns the exception's arguments. In this case, its the exception's message
, which is a key for the LOGIN_ERRORS
dict.
except OLAuthenticationError as e: | ||
f.note = get_login_error(e.__str__()) | ||
if sentry.enabled: | ||
sentry.capture_exception(e) |
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.
We shouldn't need to call this manually; sentry under the hood should be capturing all these errors, even if they're except
ed. You should be able to test this by hooking up your local environment to sentry.
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.
LGTM, looks like there may be one question about
if sentry.enabled:
sentry.capture_exception(e)
but maybe we can remove these two lines and merge... and if we need to add them back in, we do 🤷
cdc5eb6
to
cb16606
Compare
State: Blocked
|
0b3a5a4
to
8298d5e
Compare
In support of #8863
Sentry
objects to allow for capturing handled exceptionsOLAuthenticationError
, which are now thrown on IA account creation failures/account/create
POST
handler to SentryTechnical
Testing
testing
OLAuthenticationError
Screenshot
Stakeholders