This PR adds descriptively typed errors to handle various cases when using the SDK. These errors are grouped into two classes:
Response errors: These are thrown when an error response is returned from the API (see error-response.ts). Note that these error values originate from the OpenAPI spec, and will change with it.
Internal errors: These are thrown when a runtime exception happens client-side. The distinct variants for these are determined by different unhappy paths in the SDK itself.
Tests have been added for the Batch client for both types of errors, but more testing could be done to ensure every type of response error is handled correctly.
TODOS:
Tests for the Realtime client still need to be added
Need to decide how we want to handle version drift for error types
Tests for unsupported environments
Maybe some code examples for how to make best use of these error types
This PR adds descriptively typed errors to handle various cases when using the SDK. These errors are grouped into two classes:
Tests have been added for the Batch client for both types of errors, but more testing could be done to ensure every type of response error is handled correctly.
TODOS: