FunctionProject/api/assets/utils/errorHandling.js

8 lines
172 B
JavaScript
Raw Normal View History

2020-08-03 12:04:07 +02:00
function errorHandling (next, { statusCode, message }) {
const error = new Error(message)
error.statusCode = statusCode
next(error)
2020-03-19 22:59:06 +01:00
}
2020-08-03 12:04:07 +02:00
module.exports = errorHandling