automatic retries on 500 doesn't happen #615
-
I have a mutate as follows
when the server returns a 500, retry doesn't happen. I'm not sure what I might be missing, any help would be much appreciate I did specify the following explicitly too |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The retry feature is only for the useSWR hook, it's not available within the
And your fetcher throw an error It will retry it. If you use
And your fetcher throw an error it will not retry and it will update the cache with the error. You can implement retry yourself inside your fetcher function, an easy way is with async-retry. |
Beta Was this translation helpful? Give feedback.
The retry feature is only for the useSWR hook, it's not available within the
mutate
function, if you use:And your fetcher throw an error It will retry it.
If you use
And your fetcher throw an error it will not retry and it will update the cache with the error.
You can implement retry yourself inside your fetcher function, an easy way is with async-retry.