Skip to content

v3.1.0 - TrampolineApparatus enum & typed HTTP exceptions

Choose a tag to compare

@AustinW AustinW released this 31 Jul 20:14
· 4 commits to main since this release
1bd627d

Added

  • Enums\Apparatus\TrampolineApparatus (TR/DM/TU) and Discipline::apparatusEnumClass(), mirroring the existing Levels\* discipline-scoped enum convention. fromApi() accepts both the code and display form and throws on anything unrecognised; tryFromApi() is the non-throwing variant.

Fixed

  • Resources now route through resolveDto() instead of Saloon's dtoOrFail(), so failed HTTP responses raise the SDK's typed exception hierarchy (AuthenticationException, NotFoundException, ValidationException, RateLimitException, ApiException) carrying the real HTTP status, instead of a generic "unable to create DTO" error that hid it.
  • UsaGymException::fromResponse() no longer fatals when the failing response body isn't parseable JSON (e.g. an empty text/html 500).

Behavioral note

Code that previously caught \LogicException from dtoOrFail() will now receive a UsaGymException subclass instead.

Full diff: v3.0.0...v3.1.0