-
Notifications
You must be signed in to change notification settings - Fork 403
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
fix(parser): remove AttributeError validation from event_parser function #5742
fix(parser): remove AttributeError validation from event_parser function #5742
Conversation
Signed-off-by: Ana Falcão <[email protected]>
Signed-off-by: Ana Falcão <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5742 +/- ##
========================================
Coverage 96.17% 96.18%
========================================
Files 231 231
Lines 10922 10919 -3
Branches 2019 2019
========================================
- Hits 10504 10502 -2
+ Misses 329 328 -1
Partials 89 89 ☔ View full report in Codecov by Sentry. |
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.
Hey @anafalcao! Thanks a lot for working on this. We need to make some small changes before we merge!
Quality Gate passedIssues Measures |
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.
Amazing work @anafalcao! APPROVED!
Issue number: #5705
Summary
Changes
Refine exception handling in the event_parser decorator and parser function. Replace the broad AttributeError catch with specific handling for ValidationError, InvalidModelTypeError, TypeError, and ValueError. This change ensures that Pydantic validation errors and invalid model type errors are raised as-is, while other type and value errors during model instantiation are wrapped in an InvalidModelTypeError. The AttributeError catch has been removed to prevent masking unrelated exceptions.
User experience
Users encounter confusing InvalidModelTypeError exceptions, even when the event parsing succeeds. Unrelated exceptions within the handler function are incorrectly attributed to event parsing issues. The PR wants to provide the users more accurate error reporting. Exceptions unrelated to event parsing are no longer masked by parser, allowing for easier debugging and a clearer understanding of where errors originate in their code.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.