Skip to content
Discussion options

You must be logged in to vote

Hi @maksymhryzodub! I'm Dosu and I’m helping the openapi-ts team.

The documentation does not confirm that throwOnError: true causes @hey-api/client-axios to reject promises on non-2xx responses, nor does it document the { status: 200, error, data } wrapper as the intended runtime shape for errors. In fact, the migration guide notes that not every client supports throwOnError, so it may have no effect in some cases, including this one see migration guide.

The client is a thin wrapper over Axios and exposes the underlying Axios instance, so you can add a response interceptor to customize error handling. To make the client reject on 4xx/5xx responses (so try/catch works as expected), you ca…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maksymhryzodub
Comment options

Answer selected by maksymhryzodub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant