diff --git a/lib/utils/w.js b/lib/utils/w.js new file mode 100644 index 0000000..b79e6c1 --- /dev/null +++ b/lib/utils/w.js @@ -0,0 +1,11 @@ +function w(handler) { + return async (request, response, next) => { + try { + await handler(request, response, next) + } catch (error) { + next(error) + } + } +} + +module.exports = w