1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-09-21 03:09:15 -04:00
shimapan/app/util/wrap.js

3 lines
158 B
JavaScript
Raw Normal View History

// Wraps an async middleware function to catch promise rejection
exports.wrap = fn =>
(req, res, next) => Promise.resolve(fn(req, res, next)).catch(next);