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
Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `list` method may throw the following errors:
496
+
[`MistralError`](./src/models/errors/mistralerror.ts) is the base class for all HTTP error responses. It has the following properties:
Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging.
541
+
### Error Classes
542
+
**Primary error:**
543
+
*[`MistralError`](./src/models/errors/mistralerror.ts): The base class for HTTP error responses.
549
544
550
-
In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `models/errors/httpclienterrors.ts` module:
545
+
<details><summary>Less common errors (7)</summary>
546
+
547
+
<br />
548
+
549
+
**Network errors:**
550
+
*[`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
551
+
*[`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
552
+
*[`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
553
+
*[`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
554
+
*[`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
555
+
556
+
557
+
**Inherit from [`MistralError`](./src/models/errors/mistralerror.ts)**:
558
+
*[`HTTPValidationError`](./src/models/errors/httpvalidationerror.ts): Validation Error. Status code `422`. Applicable to 47 of 68 methods.*
559
+
*[`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
0 commit comments