Fix logs in integration tests for unhandled exceptions without removing logger (#11635)
Setting a global exception filter for unhandled exceptions to avoid the default Nest ExceptionsHandler being called (and logging exceptions)
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
import { ArgumentsHost, Catch, ExceptionFilter } from '@nestjs/common';
|
||||
import { BaseExceptionFilter } from '@nestjs/core';
|
||||
|
||||
@Catch()
|
||||
export class MockedUnhandledExceptionFilter
|
||||
extends BaseExceptionFilter
|
||||
implements ExceptionFilter
|
||||
{
|
||||
catch(exception: any, _host: ArgumentsHost) {
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user