Skip to content

Commit

Permalink
chore(security): conseal db error details
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyoptimist committed Jun 18, 2024
1 parent e625bbc commit dd3ddef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/common/exception-filter/all-exceptions.filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class AllExceptionsFilter implements ExceptionFilter {
statusCode = exception.getStatus();
responseBody = exception.getResponse() as ResponseBody;
} else if (exception instanceof QueryFailedError) {
this.logger.error((exception as Error).stack);
statusCode = HttpStatus.BAD_REQUEST;
responseBody = {
statusCode,
Expand All @@ -46,7 +47,7 @@ export class AllExceptionsFilter implements ExceptionFilter {
statusCode = HttpStatus.NOT_FOUND;
responseBody = {
statusCode,
message: exception.message,
message: 'Record Not Found',
error: 'Record Not Found Error',
};
} else {
Expand Down

0 comments on commit dd3ddef

Please sign in to comment.