Is there a way to capture request timeout errors globally instead of using try-catch for every API call? #517
Unanswered
dodicandra
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The easiest way is probably to create a wrapper around Ky's API. If there were a built-in way to do this, what would you want Ky to do instead of throwing? Should it return nothing? That could make debugging difficult. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a scenario where I need to handle timeout errors globally instead of using
try-catch
or capturing errors withreact-query
inonError
. It becomes quite cumbersome to handle these timeout errors one by one. I hope there's a solution for this, perhaps by forwarding timeout errors tohooks
afterResponse
.Beta Was this translation helpful? Give feedback.
All reactions