Error handling in _delete_scan(), which is now handled in GUI main.js
This commit is contained in:
parent
0e3c71b958
commit
19d72bef1c
2 changed files with 27 additions and 17 deletions
|
|
@ -144,10 +144,16 @@ Vue.mixin({
|
|||
if (error.response) {
|
||||
// If the response is a nicely formatted JSON response from the server
|
||||
if (error.response.data.message) {
|
||||
return `${error.response.status}: ${error.response.data.message}`;
|
||||
return `${error.response.data.message}`;
|
||||
}
|
||||
if (error.response.data.detail) {
|
||||
return `${error.response.data.detail}`;
|
||||
}
|
||||
// If the response is just some generic error response
|
||||
return `${error.response.status}: ${error.response.data}`;
|
||||
if (error.response.data){
|
||||
return `${error.response.data}`;
|
||||
}
|
||||
return `${error.response}`;
|
||||
}
|
||||
// If we have an error object with a message, use that
|
||||
if (error.message) return `${error.message}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue