Handling Axios error in React
Better way to handle API error with Promise catch method*. axios.get(people) .then((response) => { // Success }) .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 // console.log(error.response.data); // console.log(error.response.status); // console.log(error.response.headers); } else … Read more