Created
January 20, 2018 18:58
-
-
Save DiegoRBaquero/e2a63442fae8a7d9d079d0bcfad559f1 to your computer and use it in GitHub Desktop.
express-debug-async-wrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = debug => | |
fn => | |
(req, res, next) => | |
fn(req, res, next) | |
.catch(e => { | |
e.status = e.status || 400 | |
e.debug = debug | |
next(e) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment