diff --git a/ayanova/src/api/errorhandler.js b/ayanova/src/api/errorhandler.js index 8a4dd191..9c83d3de 100644 --- a/ayanova/src/api/errorhandler.js +++ b/ayanova/src/api/errorhandler.js @@ -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); } } }; diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index c1d4e172..4504bd90 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -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