Skip to content

Commit

Permalink
chore(error-logs): fix error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
yossi-eynav committed Feb 18, 2024
1 parent 3b79cdc commit 845aa51
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/api/errorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ module.exports = (req, res) => {
Log.info('NotImplemented', err.message, url);
return Failure.notImplemented(res, err.message);
}

// serious errors
Log.error('General error', err.code, err.message, url, err.stack);
Log.error({
message: 'General error',
error: err,
});

// db errors
if (err.code === 'ER_GIS_INVALID_DATA') {
return Failure.badRequest(res, 'GIS data is invalid');
}

Log.error('General error', err.code, err.message, url, err.stack);
return Failure.error(res, 'General error. Please contact us if you receive this error.');
};

0 comments on commit 845aa51

Please sign in to comment.