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

Confusing error message for out of bound ranges #376

Closed
jeromesimeon opened this issue Jan 24, 2022 · 1 comment · Fixed by #377
Closed

Confusing error message for out of bound ranges #376

jeromesimeon opened this issue Jan 24, 2022 · 1 comment · Fixed by #377
Assignees
Labels

Comments

@jeromesimeon
Copy link
Member

jeromesimeon commented Jan 24, 2022

Bug Report 🐛

When validating an instance value which is out of bound for numerical range e.g., range=[0,10]) the error message is confusing.

For instance considering the model:

namespace test1

concept Foo1 {
    o Integer a range=[0,10]
}

And instance:

{
    "$class": "test1.Foo1",
    "a": 15
}

The error uses the value rather than the upper bound in the message:

zsh-5.8$ ./index.js validate --model test1.cto --input test1.json
9:47:08 AM - INFO: Input is invalid
9:47:08 AM - ERROR: Validator error for field undefined test1.Foo1.a: Value is outside upper bound 15
Error: Validator error for field undefined test1.Foo1.a: Value is outside upper bound 15

Expected Behavior

A less confusing error message.

@jeromesimeon
Copy link
Member Author

This bug was originally reported by Adam Milazzo

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.

1 participant