Skip to content

HttpBridge should classify timeouts and protocol errors with Bridge* errors #118

@bbopen

Description

@bbopen

Problem

HttpBridge throws generic Error for timeouts, network errors, and invalid JSON responses. This is inconsistent with NodeBridge/OptimizedNodeBridge, which use BridgeTimeoutError and BridgeProtocolError, making it harder to distinguish failure modes in callers.

Evidence

  • src/runtime/http.ts: post() throws Error on non-OK responses; abort errors bubble as generic errors; invalid JSON returns raw text.

Acceptance criteria

  • Map abort/timeouts to BridgeTimeoutError.
  • Map invalid JSON/decoder failures to BridgeProtocolError.
  • Preserve HTTP status code and body in error message.
  • Add tests to validate error class and message content.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions