-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix error in EventHandler on request with error (#1114)
When a request has an error, it would give the `on_finish` callback a response object that is `nil`. This would break when we called `response.status`, and it would fail to complete the transaction. Make sure the transaction is always completed when it's handling a transaction, by putting the outside the safety block which fetches all the request and response metadata. Check if the `response` object is `nil` before calling other methods on it to the response status tag and metric. This way we don't raise an error. Luckily no integrations of ours that have been published yet would run into this behavior. The Rails integrations uses the EventHandler, but has its own error reporting. This would only be a problem for people who use the EventHandler directly, or when we move more integrations over to use AbstractMiddleware subclasses.
- Loading branch information
Showing
3 changed files
with
117 additions
and
30 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.changesets/fix-error-reporting-for-requests-with-an-error.md
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,6 @@ | ||
--- | ||
bump: patch | ||
type: fix | ||
--- | ||
|
||
Fix error reporting for requests with an error that use the AppSignal EventHandler. |
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