0👍
axios.get(url, oprtions)
.then((response) => console.log(response))
.catch((error) => console.log(error)); // error.response, error.response.status, and so on
or
fetch(url, oprtions)
.then((response) => console.log(response))
.catch((error) => console.log(error)); // error.response, error.response.status, and so on
Read more about error handling:
Source:stackexchange.com