This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user