From ed46e877e8f23d7f8b570329bb1525d17ab98648 Mon Sep 17 00:00:00 2001 From: Sn-Kinos Date: Tue, 1 Sep 2026 01:08:13 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=9C=EB=B2=84=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=ED=97=AC=ED=8D=BC=EB=A5=BC=20=ED=95=A8=EC=88=98=20=EC=84=A0?= =?UTF-8?q?=EC=96=B8=EC=9C=BC=EB=A1=9C=20=E2=80=94=20=EC=8B=A4=ED=8C=A8=20?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=20=EC=9D=B4=ED=9B=84=EB=A5=BC=20=EB=8F=84?= =?UTF-8?q?=EB=8B=AC=20=EB=B6=88=EA=B0=80=EB=A1=9C=20=ED=8C=90=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/firebase/functions/src/core/errors.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/firebase/functions/src/core/errors.ts b/app/firebase/functions/src/core/errors.ts index c15d2a0..ea327e0 100644 --- a/app/firebase/functions/src/core/errors.ts +++ b/app/firebase/functions/src/core/errors.ts @@ -29,9 +29,16 @@ export class CatalogError extends HttpsError { } } -export const fail = (code: ErrorCode, message: string): never => { +/** + * 카탈로그 오류로 즉시 끊는다. + * + * **화살표 상수가 아니라 함수 선언으로 둔다.** TypeScript 는 `const f = (): never + * => {...}` 형태로는 호출 이후를 도달 불가로 좁히지 못한다. 그러면 호출 뒤의 + * 코드가 「값이 없을 수도 있다」로 남아 불필요한 널 검사가 번진다. + */ +export function fail(code: ErrorCode, message: string): never { throw new CatalogError(code, message); -}; +} /** * 입력이 없으면 그 자리에서 끊는다.