What's the best way to handler errors from API calls via fetch or axios handlers while creating a Global Configuration?
What I did is my fetcher check if the error is 4xx and throw an error. That way I got them as the key error returned by useSWR
@sergiodxa Yes that works! Thank you.
If anyone needs a reference, I have created a Sandbox for that: Error handling with SWR global fetch
Most helpful comment
@sergiodxa Yes that works! Thank you.
If anyone needs a reference, I have created a Sandbox for that: Error handling with SWR global fetch