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 error should be returned as JSON #6

Closed
Glavin001 opened this issue Feb 17, 2014 · 3 comments
Closed

Validation error should be returned as JSON #6

Glavin001 opened this issue Feb 17, 2014 · 3 comments

Comments

@Glavin001
Copy link
Contributor

Error:

ValidationError: Path `field` is required.
    at model.Document.invalidate (/Users/glavin/Development/repo/node_modules/mongoose/lib/document.js:1009:32)
    at /Users/glavin/Development/repo/node_modules/mongoose/lib/document.js:958:16
    at validate (/Users/glavin/Development/repo/node_modules/mongoose/lib/schematype.js:610:7)
    at /Users/glavin/Development/repo/node_modules/mongoose/lib/schematype.js:627:9
    at Array.forEach (native)
    at SchemaString.SchemaType.doValidate (/Users/glavin/Development/repo/node_modules/mongoose/lib/schematype.js:614:19)
    at /Users/glavin/Development/repo/node_modules/mongoose/lib/document.js:956:9
    at process._tickCallback (node.js:415:13)

Should be:

{
   errors: [{
     "ValidationError: Path `isolationPoint` is required., Path `tagNum` is required., Path `asset` is required."
   }]
}
@Glavin001 Glavin001 self-assigned this Feb 17, 2014
@ekryski
Copy link
Member

ekryski commented Jul 15, 2014

I've started working on making this adapter compatible with feathers v1.0. As part of that it now uses feathers.errors. I created an issue in feathers-errors so that it can handle an errors object and spit out the errors properly in JSON.

@ekryski
Copy link
Member

ekryski commented Jul 19, 2014

I have now fixed this in the 1.0-compatibility branch in conjunction with the feathers-errors v0.2.0 release. Will formally close the issue when the branch lands.

@ekryski ekryski mentioned this issue Jul 29, 2015
ekryski added a commit that referenced this issue Aug 5, 2015
@ekryski
Copy link
Member

ekryski commented Aug 5, 2015

Confirmed this now works with feathers-errors and was fixed with PR #18.

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

No branches or pull requests

2 participants