mirror of
https://github.com/Foltik/Shimapan
synced 2024-12-11 14:02:19 -05:00
5 lines
180 B
JavaScript
5 lines
180 B
JavaScript
// Wraps an async middleware function to catch promise rejection
|
|
const wrap = fn =>
|
|
(req, res, next) => Promise.resolve(fn(req, res, next)).catch(next);
|
|
|
|
module.exports = wrap; |