Skip to content

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Jan 12, 2015

When building a list of errors for ValidationError.message, include
the values of invalid properties too.

In order to keep the message reasonably short, the values are truncated
at approx 32 characters.

See the unit-tests for examples of error messages.

Supersedes #368.
A part of strongloop/strong-arc#562

/to @raymondfeng @bitmage please review
/cc @fabien @ritch FYI

Miroslav Bajtoš added 2 commits January 12, 2015 17:12
When building a list of errors for `ValidationError.message`, include
the values of invalid properties too.

In order to keep the message reasonably short, the values are truncated
at approx 32 characters.
Return the raw object data when running on Node v0.11.14+
That way all `inspect` options are always preserved.

When running on older version:
 - Honour the depth argument passed to the custom `inspect` function.
 - Disable color output, becase there is now way how to detect whether
   colors were enabled or disabled by the top-level caller.
@bajtos bajtos force-pushed the feature/include-value-in-validation-error-message branch from 2df900f to e4fc387 Compare January 12, 2015 16:12
@bitmage
Copy link
Contributor

bitmage commented Jan 14, 2015

Awesome! I'm just happy that I'll have the values present for troubleshooting. Thanks for your work!

@bajtos
Copy link
Member Author

bajtos commented Jan 14, 2015

@raymondfeng ping

@bajtos
Copy link
Member Author

bajtos commented Jan 14, 2015

@slnode test please

raymondfeng added a commit that referenced this pull request Jan 14, 2015
…dation-error-message

Include property value in the error message
@raymondfeng raymondfeng merged commit a2b5d64 into master Jan 14, 2015
@bajtos bajtos deleted the feature/include-value-in-validation-error-message branch January 15, 2015 07:08
@bajtos bajtos assigned bajtos and unassigned raymondfeng Jan 15, 2015
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.

5 participants