mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-05 20:32:35 +02:00
Fix error when there is no network connection
This commit is contained in:
parent
8613a5780f
commit
92522876b7
4 changed files with 40 additions and 34 deletions
|
@ -26,20 +26,20 @@ export default {
|
|||
// Leave response as is
|
||||
return response;
|
||||
}, error => {
|
||||
if (error.response != undefined) {
|
||||
if (error.response.status != 0) {
|
||||
// If the response is 401, redirect to /login
|
||||
if (error.response.status === 401) {
|
||||
this.$router.push({ path: '/login' })
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
// Show the error message from the server in a modal
|
||||
this.showModal("Error " + error.response.status, error.response.data['status'])
|
||||
return
|
||||
return;
|
||||
}
|
||||
// Show the error message from axios in a modal
|
||||
this.showModal("Error", error.toString());
|
||||
return error;
|
||||
return;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue