-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1366 from appsignal/deduplicate-error-causes
Deduplicate error wrappers and error causes
- Loading branch information
Showing
3 changed files
with
84 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
bump: minor | ||
type: change | ||
--- | ||
|
||
Do not report error causes if the wrapper error has already been reported. This deduplicates errors and prevents the error wrapper and error cause to be reported separately, as long as the error wrapper is reported first. | ||
|
||
```ruby | ||
error_wrapper = nil | ||
error_cause = nil | ||
begin | ||
begin | ||
raise StandardError, "error cause" | ||
rescue => e | ||
error_cause = e | ||
raise Exception, "error wrapper" | ||
end | ||
rescue Exception => e | ||
error_wrapper = e | ||
end | ||
|
||
Appsignal.report_error(error_wrapper) # Reports error | ||
Appsignal.report_error(error_cause) # Doesn't report error | ||
``` |
This file contains 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
This file contains 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