Skip to content

HttpBridge should handle JSON.stringify failures with BridgeProtocolError #120

@bbopen

Description

@bbopen

Problem

HttpBridge.post() uses JSON.stringify(body) without guarding serialization errors. If args include BigInt, circular references, or non-serializable values, the call throws a generic TypeError rather than a Bridge protocol error, and the error lacks context.

Evidence

  • src/runtime/http.ts: body: JSON.stringify(body) with no try/catch.

Acceptance criteria

  • Catch JSON serialization failures and throw BridgeProtocolError with a clear message.
  • Add a regression test using BigInt or circular args.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions