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

Validation message wrong when max value exceeded #84

Open
AndyDBell opened this issue Aug 31, 2016 · 0 comments
Open

Validation message wrong when max value exceeded #84

AndyDBell opened this issue Aug 31, 2016 · 0 comments

Comments

@AndyDBell
Copy link

Hi,

When a Document property max value is exceeded the returned error message is incorrect.
i.e. Value assigned to c.xxx is less than max, 180, got 275.16
instead of Value assigned to c.xxx is greater than max, 180, got 275.16

base-document.js line 201

if (isNumber(that._schema[key].max) && value > that._schema[key].max) {
                throw new ValidationError('Value assigned to ' + that.collectionName() + '.' + key +
                    ' is less than max, ' + that._schema[key].max + ', got ' + value);
            }

should be

if (isNumber(that._schema[key].max) && value > that._schema[key].max) {
                throw new ValidationError('Value assigned to ' + that.collectionName() + '.' + key +
                    ' is greater than max, ' + that._schema[key].max + ', got ' + value);
            }

Regards
Andy

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

No branches or pull requests

1 participant