Error thrown by the typed HTTP client when the server responds with a non-2xx status code.
try { await client.todos.get({ params: { id: 999 } });} catch (err) { if (err instanceof ApiError && err.status === 404) { console.log('Not found:', err.message); }} Copy
try { await client.todos.get({ params: { id: 999 } });} catch (err) { if (err instanceof ApiError && err.status === 404) { console.log('Not found:', err.message); }}
The HTTP status code (e.g. 404, 500).
A human-readable error description.
The parsed response body, if the server returned JSON.
Readonly
Optional
Error thrown by the typed HTTP client when the server responds with a non-2xx status code.
Example