From 909691328e70c2d6eb2a3a7240686fa434121cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 3 Sep 2026 19:36:24 -0400 Subject: [PATCH] fix: return the degraded deep-health report instead of throwing The API answers GET /v1/health/deep with 503 and a full report when a dependency is down. handleResponse treated that as an error, so deepHealth() could never report a degraded status. The Go SDK already accepts 503 for this endpoint. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq --- src/client.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client.ts b/src/client.ts index ba5ba5f..47e6a49 100644 --- a/src/client.ts +++ b/src/client.ts @@ -285,9 +285,13 @@ export class ElydoraClient { return handleResponse(res); } + /** 503 carries the degraded report, not an error. */ async deepHealth(): Promise { const url = `${this.baseUrl}/v1/health/deep`; const res = await fetch(url, { method: 'GET', headers: { 'Accept': 'application/json' } }); + if (res.status === 503) { + return (await res.json()) as DeepHealthResponse; + } return handleResponse(res); }