-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ✨ explain() errors
#208
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
Hopefully makes errors easier to read
lwjohnst86
left a comment
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.
Super cool 🎉 Some small comments so far 🖊️
Moves all logic out of init() and instead into two separate functions: one for iterating over the errors and adding a general message, and one for formatting the message for each issue.
|
@joelostblom build fails though! |
lwjohnst86
left a comment
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.
Nice! Very minor comment about naming
To avoid having to specify it everywhere where it is not used.
For certain error types, a dict or list is set as the instance, which means logic elsewhere that calls `set()` on `Issue` fails.
Since we perform deduplication of Issues later, we need to either only allow hashable items or write custome comparison logic to compare unhashable ones. Technically, writing custom comparison logic that ignores unhashable values might be the most theoretically appropriate (since it is redundant to compare `instance` when also comparing `jsonpath`), but it could look convoluted and have worse performance. This is a simpler solution that is easy to understand and that does not involve any significant performance penalty as the extra comparison is of small items. Trying this out as a first approach and changing if we notice that there are occasions where we would value having access to an unhashable instance. For more discussion, see: #208 (comment)
lwjohnst86
left a comment
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.
Look super nice! Just some small comments about docstrings.
But always include it in the Issue object instead of sometimes excluding it based on whether it is hashable or not. See further discussion in #208 (comment)
But always include it in the Issue object instead of sometimes excluding it based on whether it is hashable or not. See further discussion in #208 (comment)
d707704 to
3c4798b
Compare
|
@lwjohnst86 @martonvago I think I have addressed everything we discussed so far and tests are passing so I'm marking this as ready for a review! A few things I intentionally left out:
|
martonvago
left a comment
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.
Really nice ⭐!!
I added some comments, feel free to ignore what you don't care about
Co-authored-by: martonvago <57952344+martonvago@users.noreply.github.com>
joelostblom
left a comment
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.
Thanks @martonvago ! I went through and tried to address your comments.
lwjohnst86
left a comment
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.
Very nice 🎉

Creates a more human readable format to explain error messages
Closes #11, closes #58, closes #14
Needs an in-depth review.
Checklist
just run-all