mirror of
https://github.com/pawelmalak/flame.git
synced 2026-02-28 01:13:11 +08:00
Category model and controllers
This commit is contained in:
@@ -5,10 +5,10 @@ const errorHandler = (err, req, res, next) => {
|
||||
let error = { ...err };
|
||||
error.message = err.message;
|
||||
|
||||
if (error.errors[0].type === 'unique violation') {
|
||||
const msg = error.errors[0].message;
|
||||
error = new ErrorResponse(`Field ${msg}`, 400);
|
||||
}
|
||||
// if (error.errors[0].type === 'unique violation') {
|
||||
// const msg = error.errors[0].message;
|
||||
// error = new ErrorResponse(`Field ${msg}`, 400);
|
||||
// }
|
||||
|
||||
console.log(error);
|
||||
console.log(`${err}`.bgRed);
|
||||
|
||||
Reference in New Issue
Block a user