-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(snetry apps): Make SentryAppSentryErrors for Sentry side errors #83080
chore(snetry apps): Make SentryAppSentryErrors for Sentry side errors #83080
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #83080 +/- ##
==========================================
- Coverage 87.59% 87.58% -0.01%
==========================================
Files 9423 9428 +5
Lines 536407 536529 +122
Branches 21120 21120
==========================================
+ Hits 469839 469911 +72
- Misses 66209 66259 +50
Partials 359 359 |
try: | ||
external_issue = ExternalIssueCreator( | ||
install=installation, | ||
group=group, | ||
web_url=data["webUrl"], | ||
project=data["project"], | ||
identifier=data["identifier"], | ||
).run() | ||
except Exception as e: | ||
error_id = capture_exception(e) | ||
return Response( | ||
{ | ||
"error": f"An issue occured while trying to create external issue. Sentry error ID: {error_id}" | ||
}, | ||
status=500, | ||
) |
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.
Previously we had an exception catcher in the endpoint and because we determined any errors happening from this block would be our fault we responded here. Now we can use the top level error handler to do that and let the exception go up.
error_id = sentry_sdk.capture_exception(exception) | ||
return Response( | ||
{ | ||
"error": f"An issue occured during the Sentry App process. Sentry error ID: {error_id}" |
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.
nit: customers don't know what a sentry app is, that's our internal term. Want to use something like "integration"?
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
tl:dr This PR adds a new error type for Sentry side errors that shouldnt be sent to the integrator but still should be handled gracefully. So we can distinguish between truly Unhandled exceptions, and exceptions we have audited and thought about.
Context: Currently with only
SentryAppErrors
(client side errors) &SentryAppIntegratorErrors
(integrator side errors) if we have a non wrapped error (i.e our fault error) then it will go through the default django rest_framework exception handler. This is okay for certain errors like authentication (i.e children ofAPIException
) which rest_framework handles gracefully. However, if the exception does not inherit fromAPIException
, they will be considered 'Unhandled' in Sentry.