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

Include field path in non serializable error #1905

Merged
merged 1 commit into from
May 4, 2024

Conversation

yannham
Copy link
Member

@yannham yannham commented May 3, 2024

Related #1460.

When failing to serialize a function which hasn't been properly applied (applied to too few arguments), the error often points to a unusable location: it is most often the definition site of the function, which doesn't help in finding the usage site that is at fault. This happens in particular with contracts, and the error is even more surprising there, because the user didn't really put a function somewhere in their config (see #1460).

This commit enriches the error message of non-serializable errors with a path, à la JSON pointer (such that it also integrates array indices), whenever possible. This should make debugging non serializable error much nicer.

When failing to serialize a value, the error sometimes doesn't point to
a usable location (that is, it points to the definition site of some
function somewhere, but it's impossible to know where this function was
actually used, which is usually where the issue is).

This commit enriches the error message of non-serializable errors with a
path, à la JSON pointer (such that it also integrates array indices),
whenever possible. This should make debugging non serializable error
much nicer.
@yannham yannham requested review from jneem and vkleen May 3, 2024 12:46
@github-actions github-actions bot temporarily deployed to pull request May 3, 2024 12:49 Inactive
@yannham yannham added this pull request to the merge queue May 4, 2024
Merged via the queue into master with commit efbe86b May 4, 2024
5 checks passed
@yannham yannham deleted the error/nonser-include-field-path branch May 4, 2024 13:57
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.

2 participants