From 0e525b0d178a92e8ed97af4f4739ee3f839e0ceb Mon Sep 17 00:00:00 2001 From: Nils-Johan Gynther Date: Thu, 30 Apr 2026 13:25:02 +0200 Subject: [PATCH] fix: receipt-import 201/octet-stream, quick-import types, exception filter guard --- backend/src/common/filters/global-exception.filter.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/common/filters/global-exception.filter.ts b/backend/src/common/filters/global-exception.filter.ts index 49994634..0d8c1201 100644 --- a/backend/src/common/filters/global-exception.filter.ts +++ b/backend/src/common/filters/global-exception.filter.ts @@ -24,6 +24,12 @@ export class GlobalExceptionFilter implements ExceptionFilter { private readonly logger = new Logger(GlobalExceptionFilter.name); catch(exception: any, host: ArgumentsHost) { + // Guard: only handle HTTP contexts (not WebSocket, RPC, etc.) + if (!host || host.getType() !== 'http') { + this.logger.error(`Non-HTTP exception caught: ${exception?.message ?? exception}`); + return; + } + const ctx = host.switchToHttp(); const response = ctx.getResponse(); const request = ctx.getRequest();