Overview
AllExceptionsFilter.catch() (backend/src/common/filters/all-exceptions.filter.ts) falls through to message = exception.message for any non-HttpException error, then returns it in the JSON response body. A raw driver error (a Postgres constraint message, an unexpected null-reference stack trimmed to its first line, etc.) is sent straight to the API client. The only existing test for this filter, in backend/src/mxllv-common.spec.ts, is expect(filter).toBeDefined() — it never exercises the actual catch() behavior, so this was never caught.
Tasks
Acceptance Criteria
Notes for Contributors
Comment below to be assigned.
Overview
AllExceptionsFilter.catch()(backend/src/common/filters/all-exceptions.filter.ts) falls through tomessage = exception.messagefor any non-HttpExceptionerror, then returns it in the JSON response body. A raw driver error (a Postgres constraint message, an unexpected null-reference stack trimmed to its first line, etc.) is sent straight to the API client. The only existing test for this filter, inbackend/src/mxllv-common.spec.ts, isexpect(filter).toBeDefined()— it never exercises the actualcatch()behavior, so this was never caught.Tasks
HttpExceptionerrors, return a fixed generic message (e.g.'Internal server error') in the response body while still logging the realexception.message/stack via the existingLogger.error()call.HttpExceptionstill surfaces its own message/status, and a genericErrorthrown from a service surfaces only the generic message with a 500 status.Acceptance Criteria
Errornever putsexception.messagein the HTTP response body.HttpExceptionresponses are unchanged.catch().Notes for Contributors
Comment below to be assigned.