Skip to content

Instantly share code, notes, and snippets.

@amun1303
amun1303 / axios-catch-error.js
Created March 9, 2018 04:30 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
axios.put(this.apiBaseEndpoint + '/' + id, input)
.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);