From 46c28969356b84a60aa9f4a73ce67c71066117e3 Mon Sep 17 00:00:00 2001 From: barsa Date: Tue, 25 Nov 2025 18:31:25 +0900 Subject: [PATCH] Add endpoint not found error mapping to SecureErrorMapperService - Introduced a new error mapping for "ENDPOINT_NOT_FOUND" with a corresponding code and public message to enhance error handling. - Added a routing pattern to map HTTP method errors to the same "ENDPOINT_NOT_FOUND" code and message for consistent user feedback. --- .../services/secure-error-mapper.service.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/bff/src/core/security/services/secure-error-mapper.service.ts b/apps/bff/src/core/security/services/secure-error-mapper.service.ts index d04ae1d9..67a7918c 100644 --- a/apps/bff/src/core/security/services/secure-error-mapper.service.ts +++ b/apps/bff/src/core/security/services/secure-error-mapper.service.ts @@ -205,6 +205,14 @@ export class SecureErrorMapperService { logLevel: "info", }, ], + [ + "ENDPOINT_NOT_FOUND", + { + code: "VAL_003", + publicMessage: "The requested resource was not found", + logLevel: "info", + }, + ], // Business Logic Errors [ @@ -357,6 +365,16 @@ export class SecureErrorMapperService { }, }, + // HTTP/Routing patterns + { + pattern: /^Cannot\s+(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)\s+/i, + mapping: { + code: "VAL_003", + publicMessage: "The requested resource was not found", + logLevel: "info", + }, + }, + // Validation patterns { pattern: /invalid|required|missing|validation|format/i,