Skip to content

feat: typed PrimeApiError handling (v1.12.0) - #5

Merged
cfluke-cb merged 2 commits into
mainfrom
carl-fluke/update-spec-2026-08-28-futures
Sep 3, 2026
Merged

feat: typed PrimeApiError handling (v1.12.0)#5
cfluke-cb merged 2 commits into
mainfrom
carl-fluke/update-spec-2026-08-28-futures

Conversation

@cfluke-cb

@cfluke-cb cfluke-cb commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Raise typed Prime API errors from Client.request and move generated *ErrorResponse models into prime_sdk/generated/errors.py. JSON error bodies now populate code, subcode, trace_id, and a generated body dataclass on HTTP-status subclasses of PrimeApiError.

Canonical exception names are PrimeSdkError and PrimeApiError. The previous PrimeSDKError and PrimeAPIError names remain as aliases.

Rebased onto main after v1.11.0 landed in #4.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency update
  • Refactor / cleanup
  • Other (describe below)

Checklist

  • Tests included / updated
  • Changelog updated
  • Version bump if needed

@cfluke-cb
cfluke-cb requested review from a team as code owners September 1, 2026 14:19
@cb-heimdall

cb-heimdall commented Sep 1, 2026

Copy link
Copy Markdown

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Comment thread prime_sdk/examples/advanced/handle_api_errors.py Outdated
Comment thread prime_sdk/examples/orders/create_order.py Outdated
Comment thread prime_sdk/__init__.py
Comment thread prime_sdk/exceptions.py Outdated
Comment thread prime_sdk/version.py
Comment thread setup.py
cfluke-cb and others added 2 commits September 1, 2026 10:33
…rror.

Keep the old names as aliases so existing except clauses continue to work.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cfluke-cb cfluke-cb changed the title feat: typed API errors and futures/financing endpoints (v1.12.0) feat: typed PrimeApiError handling (v1.12.0) Sep 1, 2026
@cfluke-cb
cfluke-cb force-pushed the carl-fluke/update-spec-2026-08-28-futures branch from a55a763 to 42f9974 Compare September 1, 2026 14:36
@cfluke-cb
cfluke-cb merged commit 1a231e8 into main Sep 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants