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 <noreply@anthropic.com>
This commit is contained in:
parent
b3a179971e
commit
0b50400a45
1 changed files with 3 additions and 5 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue