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

Misleading error message for error in function body #297

Closed
bimmlerd opened this issue Jan 15, 2019 · 0 comments · Fixed by #341
Closed

Misleading error message for error in function body #297

bimmlerd opened this issue Jan 15, 2019 · 0 comments · Fixed by #341
Labels

Comments

@bimmlerd
Copy link

Hello,

We are seeing undescriptive/misleading error messages when an error occurs within a function. Two minimal examples follow.

(
$A := function(){$min(2, 3)};
$A()
)

Link to JSONata exerciser

This throws Argument 2 of function "A" does not match function signature, which is hard to understand, since A does not seem to take arguments. Furthermore, the offending call is to min, not A.

Similarly,

(
$B := function(){""};
$A := function(){2 + $B()};
$A()
)

Link to JSONata exerciser

throws The right side of the "A" operator must evaluate to a number. This is unexpected as it should say the right side of the + operator must evaluate to a number.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants