mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-01 21:30:21 +00:00
fix(digitalocean): catch billing 403 thrown by doApi on droplet creation (#2628)
doApi() throws on any non-2xx response before the isBillingError() check at the call site could execute, making billing error detection dead code. Wrap the POST /droplets call in asyncTryCatch so the thrown error message (which includes the response body) is checked with isBillingError(). If it matches a billing pattern, handleBillingError() is shown with the billing page link and retry prompt — same UX as the proactive first-run warning. Also adds a test asserting isBillingError() matches errors in the format doApi throws (regression guard for #2395). Fixes #2395 Agent: issue-fixer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d435963dbc
commit
0f9bbd399c
3 changed files with 32 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "0.18.2",
|
||||
"version": "0.18.3",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue