mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 03:29:37 +02:00
Category model and controllers
This commit is contained in:
parent
5c948e1a68
commit
100f274d96
8 changed files with 164 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue