8 lines
172 B
JavaScript
8 lines
172 B
JavaScript
function errorHandling (next, { statusCode, message }) {
|
|
const error = new Error(message)
|
|
error.statusCode = statusCode
|
|
next(error)
|
|
}
|
|
|
|
module.exports = errorHandling
|