axios-catch-error.js 7 �gU � ;�gU /* * Handling Errors using async/await * Has to be used inside an async function */ try { const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); // Success 🎉 console.log(response); } catch (error) { // Error 😨 if (error.response) { /* * The request was made and the server responded with a * status code that falls out of the range of 2xx */ con
![Catch request errors with Axios](https://cdn-ak-scissors.b.st-hatena.com/image/square/1ef26f6cb4349557952890dbe3e567f7f98dc151/height=288;version=1;width=512/https%3A%2F%2Fgithub.githubassets.com%2Fassets%2Fgist-og-image-54fd7dc0713e.png)