Skip to content

fix(api): mark Telegram's 500 and -503 failures retryable - #184

Merged
neoromantic merged 1 commit into
mainfrom
bb/tg-pr-actionable-errors-thr_dd2utyv84i
Nov 18, 2026
Merged

neoromantic merged 1 commit into
mainfrom
bb/tg-pr-actionable-errors-thr_dd2utyv84i

Conversation

@neoromantic

Copy link
Copy Markdown
Owner

What and why

Follow-up to #177. error.retryable was false for every TELEGRAM_ERROR, including Telegram's own failures that can pass on a retry. tg api already puts Telegram's error code in details.telegramErrorCode, so it now marks 500 (INTERNAL) and -503 (timeout) as retryable: true. Codes, exit codes, messages and details don't change.

Other TELEGRAM_ERROR catch-alls stay retryable: false: they don't read the RPC code, and classifying them is out of scope here.

How I checked it

  • New e2e cases in src/__e2e__/api.e2e.test.ts: the fake client answers 500 INTERNAL and -503 Timeout, and the error is TELEGRAM_ERROR, exit 5, retryable: true. A 400 stays retryable: false.
  • bun run check clean, bun run test 2304 pass, bun run test:e2e 439 pass.
  • No live API run: no new Telegram calls, only the error report changes.

🤖 Generated with Claude Code

tg api already reports Telegram's error code in details.telegramErrorCode.
A 500 INTERNAL or -503 timeout is a failure on Telegram's side that can pass
on a retry, so error.retryable is true for them. Other TELEGRAM_ERROR
catch-alls stay false: they don't read the RPC code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@neoromantic
neoromantic merged commit 38f7d7b into main Nov 18, 2026
5 checks passed
@neoromantic
neoromantic deleted the bb/tg-pr-actionable-errors-thr_dd2utyv84i branch November 18, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant