Skip to content
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

Provide handled: true attribute for Rails.error.report method, because it is required in Rails 7.0. #8

Merged
merged 4 commits into from
Jun 7, 2024

Conversation

skatkov
Copy link
Collaborator

@skatkov skatkov commented Jun 6, 2024

handled: true attribute is required for Rails.error.report method in Rails 7.0, but not required in Rails 7.1.

See relevant code in rails.

@skatkov skatkov requested a review from julik June 6, 2024 16:00
@julik
Copy link
Contributor

julik commented Jun 6, 2024

If we have handled we know that it is unhandled if we expose it to the webhook sender in a way. Maybe use the value returned by the handler for it?

@skatkov
Copy link
Collaborator Author

skatkov commented Jun 7, 2024

@julik I don't think handled means what you think it means.

handled: true stands for error that was rescued and something was doneto deal with it. Since we're always reporting from a rescue block, it appears that we "handled" reported error.

Please check out the source of rails itself
https://github.com/rails/rails/blob/v7.0.8.4/activesupport/lib/active_support/error_reporter.rb#L57-L69

.record method re-raises errors, but they use handled: false for that.
.handle method will swallow an error and continue as nothing happened, and they use handled: true for that.

@skatkov skatkov merged commit 584fba6 into main Jun 7, 2024
1 check passed
@skatkov skatkov deleted the error_handled branch June 7, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants