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

fix: improve error msg on calling json on void function #286

Merged
merged 6 commits into from
Sep 9, 2023

Conversation

ghost
Copy link

@ghost ghost commented Aug 7, 2023

Closes #278

The error returned on calling json() after execution of a void function is:

Error: DataConversion

Caused by:
    EOF while parsing a value at line 1 column 0

The change proposed gives more context to the error as such:

Error: DataConversion

Caused by:
    the function call returned an empty value, which cannot be parsed as JSON

@ghost ghost marked this pull request as ready for review August 7, 2023 10:16
@ghost
Copy link
Author

ghost commented Aug 8, 2023

I added an example though I don't feel it's completely necessary but I'll leave as is and wait for feedback.
I've also added commentary at the top of the implementation why it's an nice add-on.

@ghost
Copy link
Author

ghost commented Aug 11, 2023

@frol This PR is ready to be reviewed

workspaces/src/result.rs Outdated Show resolved Hide resolved
@ghost ghost requested a review from frol August 22, 2023 09:17
@frol frol enabled auto-merge (squash) September 9, 2023 09:02
@frol frol merged commit a885809 into near:main Sep 9, 2023
3 checks passed
@ghost ghost deleted the fix/error-msg-on-json-on-void-func branch October 3, 2023 16:08
@frol frol mentioned this pull request Oct 4, 2023
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.

Improve error message when calling json on void function
1 participant