You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .changeset/true-lemons-think.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,10 @@
5
5
Add comprehensive type-safe error handling and configurable status codes
6
6
7
7
-**Type-safe error handling**: Added discriminated unions for API responses with `SafeApiResponse` and `TypedApiResponse` types that distinguish between success and error responses based on HTTP status codes
8
+
-**TypedResponseError class**: Introduced `TypedResponseError` that extends the native Error class to include typed response data for easier error handling
9
+
- Expose `successStatusCodes` and `errorStatusCodes` arrays on the generated API client instance for runtime access
8
10
-**withResponse parameter**: Enhanced API clients to optionally return both the parsed data and the original Response object for advanced use cases
11
+
-**throwOnStatusError option**: Added `throwOnStatusError` option to automatically throw `TypedResponseError` for error status codes, simplifying error handling in async/await patterns, defaulting to `true` (unless `withResponse` is set to true)
0 commit comments