xpepermint / Mongo Error Parser
MongoError message parser
Stars: ✭ 11
Programming Languages
javascript
184084 projects - #8 most used programming language
mongo-error-parser
Mongodb error message parser.
This is a simple helper package allows for parsing MongoDB error messages. Use this package to get detailed data from the error message (e.g. index name
for code 11000
).
Install
$ npm install mongo-error-parser
Example
const parse = require('mongo-error-parser');
try {
// mongo code here which throws e.g. unique index error
} catch (e) {
parse(e); // -> {name:, message:, code:, index:}
}
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].