This commit is contained in:
2019-07-24 15:09:00 +00:00
parent 604fe1dd72
commit 565a092251
10 changed files with 77 additions and 76 deletions

View File

@@ -1,7 +1,5 @@
/* Xeslint-disable */
import store from "../store";
import locale from "./locale";
import gzevent from "./eventbus";
var devModeShowErrors = false;
////////////////////////////////////////////////////////
@@ -9,20 +7,20 @@ var devModeShowErrors = false;
// Localize, Log and optionally display errors
// return localized message in case caller needs it
function dealWithError(msg, vm) {
msg = locale.translateString(msg);
msg = window.$gz.locale.translateString(msg);
//In some cases the error may not be localizable, if this is not a debug run then it should show without the ?? that localizing puts in keys not found
//so it's not as wierd looking to the user
if (!devModeShowErrors && msg.includes("??")) {
msg = msg.replace("??", "");
}
store.commit("logItem", msg);
window.$gz.store.commit("logItem", msg);
if (devModeShowErrors) {
var errMsg =
"DEV ERROR errorHandler::devShowUnknownError - unexpected error: \r\n" +
msg;
//eslint-disable-next-line
console.log(errMsg);
gzevent.$emit("notify-error", errMsg);
window.$gz.eventbus.$emit("notify-error", errMsg);
}
//If a form instance was provided (vue instance)