graceful-catch

1.0.1 • Public • Published

graceful-catch

Gracefully handle promise rejections within express routes

Usage

$ yarn install graceful-catch --save or $ npm install graceful-catch --save

const express = require('express'),
    gracefulCatch = require('graceful-catch'),
    app = express();

app.get('/test', (req, res, next) => {
    somePromise
        .then(success)
        .catch(gracefulCatch(res));
});

Readme

Keywords

none

Package Sidebar

Install

npm i graceful-catch

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bcruddy