세금계산서 발행 완료

This commit is contained in:
leeheejin
2025-12-08 16:01:59 +09:00
parent f04a3e3505
commit ab1308efe8
16 changed files with 3701 additions and 1 deletions

View File

@@ -28,6 +28,16 @@ export const errorHandler = (
// PostgreSQL 에러 처리 (pg 라이브러리)
if ((err as any).code) {
const pgError = err as any;
// 원본 에러 메시지 로깅 (디버깅용)
console.error("🔴 PostgreSQL Error:", {
code: pgError.code,
message: pgError.message,
detail: pgError.detail,
hint: pgError.hint,
table: pgError.table,
column: pgError.column,
constraint: pgError.constraint,
});
// PostgreSQL 에러 코드 참조: https://www.postgresql.org/docs/current/errcodes-appendix.html
if (pgError.code === "23505") {
// unique_violation
@@ -42,7 +52,7 @@ export const errorHandler = (
// 기타 무결성 제약 조건 위반
error = new AppError("데이터 무결성 제약 조건 위반입니다.", 400);
} else {
error = new AppError("데이터베이스 오류가 발생했습니다.", 500);
error = new AppError(`데이터베이스 오류: ${pgError.message}`, 500);
}
}