Skip to content

Commit

Permalink
fix: Removes logging of client errors (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryasmi authored Mar 30, 2021
1 parent dcdb1f1 commit fb0b4f5
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/expressPresenter/utils/handleError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default ({ config, errorId, res, err }: Options): Response => {
if (err instanceof InvalidAuth) {
const code = 400;
const message = translator.invalidAuthError(err);
logError(message);
return sendMessage({ res, code, errorId, message });
}
if (err instanceof Warnings) {
Expand All @@ -34,25 +33,21 @@ export default ({ config, errorId, res, err }: Options): Response => {
return translateWarning(translator, warning);
});
const obj = { warnings: strWarnings };
logError('Validation warnings', strWarnings);
return sendObject({ res, code, errorId, obj });
}
if (err instanceof NoModel) {
const code = 404;
const message = translator.noModelError(err);
logError(message);
return sendMessage({ res, code, errorId, message });
}
if (err instanceof Unauthorised) {
const code = 401;
const message = translator.unauthorisedError(err);
logError(message);
return sendMessage({ res, code, errorId, message });
}
if (err instanceof Forbidden) {
const code = 403;
const message = translator.forbiddenError(err);
logError(message);
return sendMessage({ res, code, errorId, message });
}
{
Expand Down

0 comments on commit fb0b4f5

Please sign in to comment.