Normalizing API errors with axios.
Just take me to the main code snippet
Handling errors when fetching is a pain. Usually, I would just wrap the call in a try...catch block like this.
try {
const res = await axios.get("http://localhost:4000/user")
// do something
} catch (...
blog.paolotiu.com4 min read