Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Commit

Permalink
Don't change error for featherError instance
Browse files Browse the repository at this point in the history
related to #612
  • Loading branch information
mohammadranjbarz committed Sep 14, 2021
1 parent fc416fe commit 75de4fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const parseErrors = () => context => {
logger.info('Mongo error in feathers call', context.error);
throw new errors.BadRequest(errorMessages.INVALID_INPUT_DATA);
}
if (context.error.stack) {
// Should not return stack error to client
if (context.error.stack && context.error.type !== 'FeathersError') {
// Should not return stack error to client when error is not instance of Feathers error
logger.info('Error with stack', context.error);
throw new errors.GeneralError();
}
Expand Down

0 comments on commit 75de4fd

Please sign in to comment.