5 lines
178 B
JavaScript
5 lines
178 B
JavaScript
module.exports = (err, req, res, next) => {
|
|
if (!(err instanceof SyntaxError)) return next();
|
|
|
|
res.status(400).json({message: "You need to provide a valid JSON body"});
|
|
} |