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

Improved error handling #29

Merged
merged 1 commit into from
Jul 7, 2016
Merged

Conversation

stenlarsson
Copy link
Contributor

@stenlarsson stenlarsson commented Apr 28, 2016

Consider the following expression:

`foo`

This expression contains an invalid json-value, and this will raise the unhelpful error unexpected token 0. The reason for the zero is that Symbol#match surprisingly returns a fixnum, unlike String#match. Still, unexpected token unknown would not be much better, therefore unknown tokens raise a separate error, in this case unknown token "foo".

(Note that this particular expression is accepted by other implementations, but I don't think it should be according to the specification.)

1. `Symbol#match` and `String#match` surprisingly doesn't have the same return type
2. Raise a better error on an unknown token
@trevorrowe trevorrowe merged commit e164f0b into jmespath:master Jul 7, 2016
@trevorrowe
Copy link
Contributor

Sorry for the slow response. Thank you for the fix. This should be part of the 1.3 release shortly.

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

2 participants