Skip to content

fix(volcengine): rethrow errors in catch blocks instead of returning them#177

Open
Ricardo-M-L wants to merge 1 commit into
agent-infra:mainfrom
Ricardo-M-L:fix/volcengine-swallow-errors
Open

fix(volcengine): rethrow errors in catch blocks instead of returning them#177
Ricardo-M-L wants to merge 1 commit into
agent-infra:mainfrom
Ricardo-M-L:fix/volcengine-swallow-errors

Conversation

@Ricardo-M-L

Copy link
Copy Markdown

Summary

Fixes #176.

All five VolcengineProvider methods catch errors and silently return them as values, which means the caller's Promise resolves with an Error instance instead of rejecting. Standard try { await provider.xxx() } catch (e) {} patterns never trigger, making failures invisible.

Changed every return error in a catch block to throw error so rejections propagate naturally.

Affected methods

  • createSandbox (line 89)
  • deleteSandbox (line 127)
  • getSandbox (line 205)
  • setSandboxTimeout (line 244)
  • listSandboxes (line 304)

Test plan

  • Added sdk/js/__test__/providers/volcengine.test.ts with 5 tests, one per method — each mocks request to reject, then asserts the provider method rejects with the same error.

Related

Part of splitting closed PR #167 into focused single-bug PRs. Previously opened: #171 (Bug 1), #173 (Bug 2), #175 (Bug 3). This is Bug 4.

🤖 Generated with Claude Code

…eturning them

All five VolcengineProvider methods (createSandbox, deleteSandbox,
getSandbox, setSandboxTimeout, listSandboxes) caught errors and then
did `return error`, treating the caught Error as a success value. The
caller's `await provider.createSandbox(...)` would resolve with an
Error instance instead of rejecting, which means try/catch at the call
site never triggers and consumers can't distinguish success from
failure without explicit `instanceof Error` checks on every response.

Changed all catch blocks to `throw error` so promise rejections
propagate naturally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Volcengine provider: catch blocks silently swallow errors via return error

1 participant