-
Notifications
You must be signed in to change notification settings - Fork 8
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
Make ConversionErrors more useful #167
Conversation
- Subclass into ConversionToPythonFailed and ConversionToStarlarkFailed - Make messages much more informative and indicate which key or index failed - If conversion fails because of a Python exception, add that exception as the source of ours Closes #143
@colindean LMK what you think of this; the error messages now call out the index or key (and the case of conversion from Starlark to Python, the actual value since we have a handy representation) that fails the conversion. This will make the errors pretty long for deeply nested containers, since each parent prepends its stamp on to the error, but I'd rather have useful errors than pretty ones. |
(Examples of what the new errors look like in practice can be found in the new tests) |
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.
I think it's a big improvement!
Thanks for doing this! Definitely agree it's a huge improvement from:
Might be worth releasing on |
@tadamcz I thought I was going to barrel ahead to a 2.0 with support for structs and compiled expressions but I got bogged down in how I want to actually expose that stuff on the Python side; still need to think about it some more. I'll kick a 1.1 out to PyPI in the next couple days since |
Closes #143