Conversation
6898ada to
763cd8a
Compare
Contributor
Author
|
@sujh not sure if you'd want to give this a look before I merge it? |
|
Hope this can be merged as soon as possible! |
Sentry::Error represents errors SDK raises intentionally. Sentry::ExternalError represents errors by the SDK, but casused by external reasons, like networking issues.
The code invoked by the SDK itself, whether it's an external service call (like sending events) or a user-defined callback (like async or before_send), shouldn't cause the user's application to crash. Although some may think errors caused by user-defined callbacks should be raised for debugging purpose, it's actually a bad practice in reality. Most of the users only activate the SDK in production and they don't write tests for the callbacks. So if there's any bug in the callbacks, they will usually be spotted in production. Also, because the SDK is usually placed at the farthest layer of the app to catch all the possible exceptions, there won't be anything to capture exceptions triggered by the SDK. So from the SDK's perspective, we can either raise them or swallow them: - If we raise them, the user's customers will see broken apps. Good for spotting bugs, very bad user experience. - If we rescue them, the user's customers won't spot a thing. It may be harder for the user to spot the buggy callback, but at least their customers won't be angry. This is why I decided to swallow any errors happen in the `Client#capture_event`.
Codecov Report
@@ Coverage Diff @@
## master #1298 +/- ##
==========================================
+ Coverage 98.02% 98.65% +0.62%
==========================================
Files 205 112 -93
Lines 8970 5263 -3707
==========================================
- Hits 8793 5192 -3601
+ Misses 177 71 -106
Continue to review full report at Codecov.
|
This was referenced Mar 12, 2021
This was referenced Mar 15, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements the error handling rules described in #1290
closes #1246, #1290 and #1289