From 0b50400a45ea3ca8c720a0dd39bf504837d3e9e4 Mon Sep 17 00:00:00 2001 From: yushen Date: Sat, 14 Feb 2026 08:51:46 +0800 Subject: [PATCH] fix(desktop): read error body instead of statusText for gateway errors res.statusText is always empty under HTTP/2, causing "Gateway error: " with no detail. Now reads the JSON response body to surface the server's actual error message and always includes the status code. Co-Authored-By: Claude Opus 4.6 --- apps/desktop/src/renderer/src/components/telegram-qr.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/renderer/src/components/telegram-qr.tsx b/apps/desktop/src/renderer/src/components/telegram-qr.tsx index 6157f6cb..cc99679d 100644 --- a/apps/desktop/src/renderer/src/components/telegram-qr.tsx +++ b/apps/desktop/src/renderer/src/components/telegram-qr.tsx @@ -50,11 +50,9 @@ export function TelegramConnectQR({ if (cancelled) return if (!res.ok) { - if (res.status === 503) { - setError('Telegram bot not configured on Gateway') - } else { - setError(`Gateway error: ${res.statusText}`) - } + const body = (await res.json().catch(() => null)) as { message?: string } | null + const detail = body?.message || `HTTP ${res.status}` + setError(`Gateway error (${res.status}): ${detail}`) setDeepLink(null) return }