Skip to content

feat!: remap exceptions into a package-specific error hierarchy - #3

Merged
ftsartek merged 1 commit into
mainfrom
feat/clearer-exceptions
Jul 20, 2026
Merged

ftsartek merged 1 commit into
mainfrom
feat/clearer-exceptions

Conversation

@ftsartek

Copy link
Copy Markdown
Collaborator
  • add ApiStatusException with ClientException (4xx) and ApiException (5xx), parsing the server's error body into status code, server message and error type; message format matches sthai-py
  • add ResponseException for unusable success responses and reparent ResponseParseException onto it
  • rename InvalidArgumentException to InputException (still extends SPL \InvalidArgumentException); remove HttpException
  • remap the no-embedding-data, encoded-string and invalid-JSON throw sites from ResponseParseException to ResponseException
  • document the hierarchy in the README, add tests/ExceptionsTest.php and update all test assertions; CHANGELOG entry for v1.1.1

Refs: sitehostnz/sthai-py#8

- add ApiStatusException with ClientException (4xx) and ApiException
  (5xx), parsing the server's error body into status code, server
  message and error type; message format matches sthai-py
- add ResponseException for unusable success responses and reparent
  ResponseParseException onto it
- rename InvalidArgumentException to InputException (still extends
  SPL \InvalidArgumentException); remove HttpException
- remap the no-embedding-data, encoded-string and invalid-JSON throw
  sites from ResponseParseException to ResponseException
- document the hierarchy in the README, add tests/ExceptionsTest.php
  and update all test assertions; CHANGELOG entry for v1.1.1

Refs: sitehostnz/sthai-py#8
@ftsartek
ftsartek merged commit b23b582 into main Jul 20, 2026
8 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.

1 participant