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