Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/migueltvms/mongoose-express-error-handler

Mongoose Express error handler plugin.
https://github.com/migueltvms/mongoose-express-error-handler

express expressjs http-status-code module mongoose mongoosejs nodejs plugin validation

Last synced: about 2 months ago
JSON representation

Mongoose Express error handler plugin.

Awesome Lists containing this project

README

        

# mongoose-express-error-handler
Mongoose Express error handler plugin.
This module convert the mongoose validation error in a bad request response and show all the validation errors without all the anoying stack trace.
## How to use it.
To use this module just add the reference to you javascript file.

```javascript
const mongooseExpressErrorHandler = require('mongoose-express-error-handler');
```

Then just add the plugin to your express app.

```javascript
const express = require('express');
const app = express();
app.use(mongooseExpressErrorHandler);
```