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
Hello everybody,
I use orval with client react-query and axios. Also, orval generates hooks for my queries. This way I not only get typed data as well as typed errors. But I wonder, how can I handle errors like a 500 (internal server error). As far as I know, these are not part of the api documentation but may happen. As these are not part of the api documentation, orval does not generate code for that of course and the error type of that query hook consists of the known errors only.
Is there some way to extend the errors with "| unknown" for these cases? What are my options?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everybody,
I use orval with client react-query and axios. Also, orval generates hooks for my queries. This way I not only get typed data as well as typed errors. But I wonder, how can I handle errors like a 500 (internal server error). As far as I know, these are not part of the api documentation but may happen. As these are not part of the api documentation, orval does not generate code for that of course and the error type of that query hook consists of the known errors only.
Is there some way to extend the errors with "| unknown" for these cases? What are my options?
Beta Was this translation helpful? Give feedback.
All reactions