This commit is contained in:
2020-04-06 21:48:55 +00:00
parent 70a2a717ac
commit e2b9f0b7a0
2 changed files with 42 additions and 49 deletions

View File

@@ -84,15 +84,23 @@ function handleError(action, error, route, reject) {
error.message.includes("Network request failed")
) {
window.$gz.store.commit("logItem", "Network error");
window.$gz.eventBus.$emit(
"notify-error",
window.$gz.translation.get("ErrorServerUnresponsive")
);
let msg = "";
if (window.$gz.store.state.authenticated) {
msg = window.$gz.translation.get("ErrorServerUnresponsive");
} else {
msg = "Could not connect to AyaNova server ";
}
msg += window.$gz.api.APIUrl("") + "\r\nError: " + error.message;
window.$gz.eventBus.$emit("notify-error", msg);
//note: using translation key in square brackets
return reject("[ErrorServerUnresponsive]");
return reject(msg);
//throw "Error: unable to contact server";
}
}
//Ideally this should never get called because any issue should be addressed above
devShowUnknownError(error);
}
@@ -306,6 +314,7 @@ export default {
})
.catch(function handleGetError(error) {
//fundamental error, can't proceed with this call
//license/trial
handleError("GET", error, route, reject);
});
});