Skip to content

fix(ts-sdk): make hosted errors catchable by base class#1416

Merged
realfishsam merged 1 commit into
mainfrom
fix/issue-1411-ts-hosted-instanceof
Jun 30, 2026
Merged

fix(ts-sdk): make hosted errors catchable by base class#1416
realfishsam merged 1 commit into
mainfrom
fix/issue-1411-ts-hosted-instanceof

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

  • Fixes TypeScript SDK hosted error detection so concrete hosted subclasses satisfy instanceof HostedTradingError.
  • Keeps existing semantic parent classes (InvalidApiKey as AuthenticationError, InsufficientEscrowBalance as InsufficientFunds, etc.) while making the hosted base catch work via Symbol.hasInstance and the existing isHostedError marker.

Fixes #1411

Test Plan

  • npm install
  • npm test --workspace=pmxtjs -- hosted-error-mapping.test.ts --runInBand
  • git diff --check

Notes

  • npm run build --workspace=pmxtjs is blocked in this checkout by missing generated TypeScript SDK artifacts: ../generated/src/index.js imported by pmxt/client.ts and pmxt/server-manager.ts.

@realfishsam realfishsam merged commit fa72f46 into main Jun 30, 2026
11 checks passed
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.

TS SDK: hosted error subclasses don't extend HostedTradingError — instanceof HostedTradingError only catches the base class

1 participant