251113_02_FIX : ESLINT 오류 해결
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user