-
Notifications
You must be signed in to change notification settings - Fork 50
feat: add error wrapping support to ResolutionError #438
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
Conversation
Add the ability to preserve original errors in ResolutionError. This enables providers to wrap underlying errors while maintaining backward compatibility, allowing callers to use errors.Is() and errors.As() for error inspection. Signed-off-by: Roman Dmytrenko <[email protected]>
Summary of ChangesHello @erka, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces robust error wrapping capabilities to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #438 +/- ##
==========================================
+ Coverage 85.57% 85.89% +0.31%
==========================================
Files 20 20
Lines 1435 1446 +11
==========================================
+ Hits 1228 1242 +14
+ Misses 186 183 -3
Partials 21 21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Code Review
This pull request introduces error wrapping for ResolutionError, which is a valuable enhancement for debugging and error inspection. The changes are well-contained and include corresponding tests. I have two suggestions to further refine the implementation. The first is to enhance the Error() method to include details from the wrapped error, making error messages more informative. The second is to simplify the NewGeneralResolutionError constructor by fully utilizing errors.Join, which will make the code more concise and idiomatic.
Signed-off-by: Roman Dmytrenko <[email protected]>
|
Should we do something similar for NewParseErrorResolutionError as well? |
Signed-off-by: Roman Dmytrenko <[email protected]>
|
Yeah, that’s a great suggestion. @sahidvelji |
This PR
errors.Is()anderrors.As()for error inspection.Related Issues
#437