mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-05-12 06:59:30 -05:00
Created the error.js middleware
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
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"});
|
||||
}
|
||||
Reference in New Issue
Block a user