Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-errors-handler

Package Overview
Dependencies
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-errors-handler

Some middleware for Express and Node that sets up Raven (or not as appropriate) depending on sensible environment variables.

  • 1.2.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
3
Weekly downloads
 
Created
Source

express-errors-handler

Some middleware for Express and Node that sets up Raven (or not as appropriate) depending on sensible environment variables.

Installation

npm install --save express-errors-handler

Usage

var express = require('express');
var app = express();
var errorMiddleware = require('express-errors-handler').middleware;

var promiseEnabledApi = require('./my-promise-enabled-api');

// A typical route using Promises
app.get('/a-typical-route', function(req, res, next) {
	promiseEnabledApi.getSomeThings()
		.then(function(someThings) {
			res.render(someThings);
		})

		// Make sure to end all Promise chains with a `catch`
		// that passes the error to the next middleware
		.catch(next);
});

// Make sure the middleware is added after your routes otherwise you'll lose the errors
app.use(errorMiddleware);

Supported environment variables

  • NODE_ENV - mode to operate in, can be either PRODUCTION (sends bugs to aggregator) or any another value (shows bugs to user)
  • RAVEN_URL - URL to report bugs captured in production

License

This software is published by the Financial Times under the MIT license.

FAQs

Package last updated on 21 Apr 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc