Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

全局异常过滤器报错 #50

Open
Sjhb opened this issue May 5, 2020 · 0 comments
Open

全局异常过滤器报错 #50

Sjhb opened this issue May 5, 2020 · 0 comments

Comments

@Sjhb
Copy link

Sjhb commented May 5, 2020

@Catch()
export class HttpExceptionFilter implements ExceptionFilter {
  // ...
  const status = exception.getStatus() || HttpStatus.INTERNAL_SERVER_ERROR;
  // ...
}

这里@catch()是否应该改为@catch(HttpException)

其它类型的异常对象可能没有getStatus方法,从而导致全局过滤器报错。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant