BaseExceptionFilter is the built-in default global exception filter in NestJS, exported from @nestjs/core. Custom filters can extend it and override behavior by calling super.catch(exception, host).
@Catch()
export class AllExceptionsFilter extends BaseExceptionFilter {
catch(exception: unknown, host: ArgumentsHost) {
super.catch(exception, host);
}
}Method-scoped and controller-scoped filters that extend BaseExceptionFilter should not be instantiated with new — let the framework handle instantiation for DI. Global filters extending BaseExceptionFilter need the HttpAdapter reference injected.