question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error handling and mongoose validation errors

See original GitHub issue

During development it is useful to see the full error reported by mongoose. E.g. you forget to assign a required parameter.

At the moment I only get ValidationError: MyModel validation failed and a useless stack trace (all methods are part of the error handling module).

Mongoose adds details in the err.errors property.

What would be the best way to get these error details through the error handling process (in APIErrors.js)?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

1reaction
mxmzbcommented, Nov 17, 2017

This is a large eyesore for me, does anyone have an idea how to handle this?

0reactions
okononcommented, Nov 28, 2017

@KunalKapadia do you have any suggestions how to proceed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve mongoose validation error handling - Stack Overflow
Whenever I enter a field against the validation rules, I get a very long error message, which is obvious. But now, I want...
Read more >
Mongoose v6.8.2: Validation
Errors returned after failed validation contain an errors object whose values are ValidatorError objects. Each ValidatorError has kind , path , value ,...
Read more >
Validation in Mongoose(where, how and handle errors)
Recently I am building an app to practice my Node.js and Express.js skills, which is connected with MongoDB with Mongoose. My progress is...
Read more >
Handling errors in Mongoose/Express to display in React | by JB
For MongoDB, there is an internal system of error classification. MongoDB assigns different names and codes to errors that can be seen by ......
Read more >
mongoose-validation-error-message-handler - npm
Mongoose Validation Error Message Handler. Latest version: 1.2.5, last published: 9 months ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found