251113_02_FIX : ESLINT 오류 해결

This commit is contained in:
2025-11-13 15:04:00 +09:00
parent 1d713325ab
commit 419f27eb9f
3 changed files with 33 additions and 3 deletions

View File

@@ -191,10 +191,24 @@ export const createHttpClient = (baseURL: string, opts: HttpClientOptions = {})
}
return parsed as T;
} catch (err: any) {
// 🔻 여기서 네트워크 레벨 에러 처리
const code = err?.cause?.code ?? err?.code;
} catch (err: unknown) {
let code: string | undefined;
if (typeof err === "object" && err !== null) {
const anyErr = err as { cause?: unknown; code?: unknown };
if (anyErr.cause && typeof anyErr.cause === "object") {
const cause = anyErr.cause as { code?: unknown };
if (typeof cause.code === "string") {
code = cause.code;
}
}
if (!code && typeof anyErr.code === "string") {
code = anyErr.code;
}
}
// 🔻 여기서 네트워크 레벨 에러 처리
if (code === "ECONNREFUSED") {
// 네트워크 연결 실패 → HttpError(404)로 변환
throw new HttpError(