Skip to content

Commit

Permalink
fix: don't log NotImplementedError to error log
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Aug 1, 2023
1 parent 9f6b44d commit cc607df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/port/middleware/ErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export async function ErrorHandler(ctx: EggContext, next: Next) {

// http status, default is DEFAULT_SERVER_ERROR_STATUS
ctx.status = err.status || DEFAULT_SERVER_ERROR_STATUS;
if (ctx.status >= DEFAULT_SERVER_ERROR_STATUS) {
// don't log NotImplementedError
if (ctx.status >= DEFAULT_SERVER_ERROR_STATUS && err.name !== 'NotImplementedError') {
ctx.logger.error(err);
}
let message = err.message;
Expand Down

0 comments on commit cc607df

Please sign in to comment.