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:
Weiko
2025-04-17 18:35:21 +02:00
committed by GitHub
parent 3fe12cd8b5
commit 19da80d2e4
2 changed files with 20 additions and 2 deletions

View File

@ -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;
}
}