1.0.1 • Published 7 years ago

graceful-catch v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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));
});