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

Improve JSON::ParseException message for empty string #4875

Conversation

kenta-s
Copy link

@kenta-s kenta-s commented Aug 23, 2017

When JSON::PullParse receives an empty string, it raises a JSON::ParseException with a message like:

Unexpected token: EOF at 1:1 (JSON::ParseException)

I think it is better to tell that JSON::PullParse got an empty string, and that's why the exception was raised.

@RX14
Copy link
Contributor

RX14 commented Aug 23, 2017

This is even more confusing (and wrong) as if you have incomplete json you can easily get this error in a non empty string.

@vegai
Copy link
Contributor

vegai commented Aug 23, 2017

Oh dear. Sorry about that thumbsup :/

@kenta-s
Copy link
Author

kenta-s commented Aug 23, 2017

I understood. Until I come up with a better implementation, I will close this PR for now.
Thank you so much for the reviews and comments :)

@kenta-s kenta-s closed this Aug 23, 2017
@kenta-s kenta-s deleted the improve-json-parse-exception-message-for-empty-string branch August 23, 2017 11:38
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.

None yet

3 participants