This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
FunctionProject/api/assets/utils/errorHandling.js

7 lines
180 B
JavaScript

function errorHandling(next, { statusCode, message }) {
const error = new Error(message);
error.statusCode = statusCode;
next(error);
}
module.exports = errorHandling;