This commit is contained in:
@@ -4,10 +4,17 @@ import locale from "./locale";
|
||||
|
||||
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)
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// Log and optionally display errors
|
||||
//
|
||||
function dealWithError(msg, displayToUser) {
|
||||
msg = 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);
|
||||
if (displayToUser || devModeShowErrors) {
|
||||
alert("~" + msg);
|
||||
|
||||
Reference in New Issue
Block a user