Improved error handling
This commit is contained in:
parent
bf8b143700
commit
e3e0a2eaf4
|
@ -86,11 +86,15 @@ axios.interceptors.response.use(function (response) {
|
||||||
} else if (error.response.status === 500) {
|
} else if (error.response.status === 500) {
|
||||||
error.backendErrors.push('A server error occured')
|
error.backendErrors.push('A server error occured')
|
||||||
} else if (error.response.data) {
|
} else if (error.response.data) {
|
||||||
for (var field in error.response.data) {
|
if (error.response.data.detail) {
|
||||||
if (error.response.data.hasOwnProperty(field)) {
|
error.backendErrors.push(error.response.data.detail)
|
||||||
error.response.data[field].forEach(e => {
|
} else {
|
||||||
error.backendErrors.push(e)
|
for (var field in error.response.data) {
|
||||||
})
|
if (error.response.data.hasOwnProperty(field)) {
|
||||||
|
error.response.data[field].forEach(e => {
|
||||||
|
error.backendErrors.push(e)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue