Skip to content

全局异常过滤器报错 #50

@Sjhb

Description

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

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions