Skip to content

fix(ts-sdk): raise hosted embedded errors#1307

Merged
realfishsam merged 1 commit into
mainfrom
fix/issue-1304-ts-embedded-errors
Jun 25, 2026
Merged

fix(ts-sdk): raise hosted embedded errors#1307
realfishsam merged 1 commit into
mainfrom
fix/issue-1304-ts-embedded-errors

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

  • Fix TypeScript hosted _tradingRequest to inspect 2xx JSON envelopes for { success: false } / { error: ... }
  • Re-raise those embedded failures through the hosted error mapper so TS matches Python behavior
  • Add a focused regression test for 2xx embedded hosted errors

Fixes #1304

Test Plan

  • npm test --workspace=pmxtjs -- --runTestsByPath tests/hosted-routing-embedded-error.test.ts --runInBand (RED before fix, PASS after fix)
  • npm test --workspace=pmxtjs -- --runTestsByPath tests/hosted-routing-embedded-error.test.ts tests/hosted-error-mapping.test.ts --runInBand
  • git diff --check

Known local environment blockers

  • npm test --workspace=pmxtjs -- --runTestsByPath tests/hosted-dispatch.test.ts --runInBand and npm run build --workspace=pmxtjs are blocked in this focused checkout because sdks/typescript/generated/src/index.js is absent; no generated SDK stubs were committed.

@realfishsam realfishsam merged commit 0804504 into main Jun 25, 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.

SDK drift: Python raise_from_response handles 2xx responses with embedded errors; TypeScript raiseFromResponse only raises on non-2xx

1 participant