mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 23:57:49 +01:00
auth using google
This commit is contained in:
7
app.js
7
app.js
@@ -74,6 +74,7 @@ app.use((error, req, res, next) => {
|
||||
switch (error.name) {
|
||||
case 'ValidationError':
|
||||
case 'MissingPasswordError':
|
||||
case 'BadRequest':
|
||||
case 'BadRequestError':
|
||||
res.status(400);
|
||||
res.json({ success: false, error });
|
||||
@@ -91,6 +92,12 @@ app.use((error, req, res, next) => {
|
||||
res.status(500);
|
||||
res.json({ success: false, error });
|
||||
}
|
||||
if (
|
||||
process.env.NODE_ENV === 'production' ||
|
||||
process.env.NODE_ENV === 'test'
|
||||
) {
|
||||
console.error(error);
|
||||
}
|
||||
next(error);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user