-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Log Recaptcha errors in Sentry #10476
Log Recaptcha errors in Sentry #10476
Conversation
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.
One question for you, I think we can just log this to have it appear in sentry
if not data.get('success', False) and 'error-codes' in data: | ||
from openlibrary.plugins.openlibrary.sentry import sentry | ||
|
||
if sentry and sentry.enabled: | ||
sentry.capture_message(f"Recaptcha Error: {data['error-codes']}") | ||
|
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.
logged exceptions are captured in sentry, so we should be able to do:
if not data.get('success', False) and 'error-codes' in data: | |
from openlibrary.plugins.openlibrary.sentry import sentry | |
if sentry and sentry.enabled: | |
sentry.capture_message(f"Recaptcha Error: {data['error-codes']}") | |
if not data.get('success', False) and 'error-codes' in data: | |
logging.getLogger("openlibrary").exception(f"Recaptcha Error: {data['error-codes']}") |
I believe.
70fd537
to
d157c7e
Compare
for more information, see https://pre-commit.ci
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.
Closes #10474
Captures the
error-codes
field of any failing ReCaptcha verification in Sentry.Technical
Testing
Screenshot
Stakeholders