This commit is contained in:
2019-04-08 19:37:57 +00:00
parent d39174bdf8
commit 4431442fc8
2 changed files with 7 additions and 7 deletions

View File

@@ -6,10 +6,10 @@ var devModeShowErrors = false;
//TODO: tie this into form error display somehow so that form can control whether to show particular error or not
//i.e. dealwitherror(msg,formerrordisplayfunction,bool shouldshowError)
function dealWithError(msg) {
function dealWithError(msg, displayToUser) {
msg = locale.translateString(msg);
store.commit("logItem", msg);
if (devModeShowErrors) {
if (displayToUser || devModeShowErrors) {
alert("~" + msg);
}
}
@@ -56,12 +56,12 @@ export default {
}
dealWithError(msg);
},
handleFormError(err) {
handleFormError(err, displayToUser) {
//called inside forms when things go wrong but are handled
if (err instanceof Error && err.message) {
dealWithError(err.message);
dealWithError(err.message, displayToUser);
} else {
dealWithError(err.toString());
dealWithError(err.toString(), displayToUser);
}
}
};

View File

@@ -192,7 +192,7 @@ export default {
this.obj = res.data;
})
.catch(function(error) {
that.$gzHandleFormError(error);
that.$gzHandleFormError(error, true);
});
},
submit() {
@@ -223,7 +223,7 @@ export default {
}
})
.catch(function(error) {
that.$gzHandleFormError(error);
that.$gzHandleFormError(error, true);
});
} else {
//say something so the user knows there is an issue