Socket
Socket
Sign inDemoInstall

mongodb-js-errors

Package Overview
Dependencies
4
Maintainers
46
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mongodb-js-errors

Helpers for handling errors from the MongoDB driver.


Version published
Weekly downloads
60
increased by200%
Maintainers
46
Install size
133 kB
Created
Weekly downloads
 

Readme

Source

mongodb-errors travis npm

Helpers for handling errors from the MongoDB driver.

Example

var express = require('express');
var app = module.exports = express();

app.use(require('mongodb-js-errors/express'));
app.use(function(err, req, res) {
  var payload = err.output.payload;
  res.format({
    text: function() {
      res.status(err.output.statusCode).send(payload.message);
    },
    json: function() {
      res.status(err.output.statusCode).send(payload);
    }
  });
});

License

Apache 2.0

FAQs

Last updated on 15 Jan 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc