I'd like to add a global error handler either on express or resourcejs level (to do additional logging/handling) but I don't see an options or params to do that and on top the default error handler seems to swallow the errors.
const error = (err, req, res, next) => {
if (err) {
res.status(400).json({
status: 400,
message: err.message || err,
});
}
else {
return next();
}
};
routeStack = [...routeStack, error.bind(this)]
Any suggestions on how to let errors through to express middleware or have a custom error handler added to resourcejs?
I'd like to add a global error handler either on express or resourcejs level (to do additional logging/handling) but I don't see an options or params to do that and on top the default error handler seems to swallow the errors.
Any suggestions on how to let errors through to express middleware or have a custom error handler added to resourcejs?