diff --git a/backend/src/common/filters/http-exception.filter.ts b/backend/src/common/filters/http-exception.filter.ts index 6297d7f..fdbec31 100644 --- a/backend/src/common/filters/http-exception.filter.ts +++ b/backend/src/common/filters/http-exception.filter.ts @@ -63,7 +63,15 @@ export class HttpExceptionFilter implements ExceptionFilter { } } else { // 정의되지 않은 예외 → 운영팀이 추적 가능하도록 로그 + SYS_001 응답 유지 - this.logger.error('Unhandled Exception', exception as Error); + // NestJS Logger 2번째 인자는 "스택 문자열"이어야 한다. Error 객체를 그대로 넘기면 + // nest-winston 이 비열거 속성을 직렬화하며 메시지/스택을 잃어 `{ stack: [ {} ] }` 로 찍힌다. + // → 메시지는 message 로, 스택은 문자열로 분리해 실제 원인이 로그에 남도록 한다. + const message = + exception instanceof Error ? exception.message : String(exception); + this.logger.error( + `Unhandled Exception: ${message}`, + exception instanceof Error ? exception.stack : undefined, + ); } response.status(status).json({