12 lines
195 B
JavaScript
12 lines
195 B
JavaScript
|
|
function w(handler) {
|
||
|
|
return async (request, response, next) => {
|
||
|
|
try {
|
||
|
|
await handler(request, response, next)
|
||
|
|
} catch (error) {
|
||
|
|
next(error)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = w
|