diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 6e90b53d..a783ff87 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -3,6 +3,12 @@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ todo: exception handling around reports sucks +todo: No message in popup should be more than can be viewed at once on a phone (600 characters maximum) +todo: Exceptions, some are still showing [object,object]! +todo: Exceptions don't show "Name: Error," ever +todo: NON DEV MODE + No stack trace in error messages! + But do keep stack trace in internal LOG for diagnosis todo: a script error when just running a report from the report selector acts weird Test with dev mode off to confirm it won't show it in the UI diff --git a/ayanova/src/api/errorhandler.js b/ayanova/src/api/errorhandler.js index 8a7f2cdc..cc57906d 100644 --- a/ayanova/src/api/errorhandler.js +++ b/ayanova/src/api/errorhandler.js @@ -1,18 +1,22 @@ /* xeslint-disable */ let lastMessageHash = 0; +let lastMessageTimeStamp = new Date(); //////////////////////////////////////////////////////// // // translate, Log and optionally display errors // return translated message in case caller needs it function dealWithError(msg, vm) { - //Check if this is the same message again as last time to avoid - //repetitive loops of useless messages + //Check if this is the same message again as last time within a short time span to avoid endless looping errors of same message + //but still allow for user to repeat operation that causes error so they can view it let newHash = window.$gz.util.quickHash(msg); if (newHash == lastMessageHash) { - return; + let tsnow = new Date(); + //don't show the same exact message if it was just shown less than 1 second ago + if (tsnow - lastMessageTimeStamp < 1000) return; } lastMessageHash = newHash; + lastMessageTimeStamp = new Date(); //translate as necessary msg = window.$gz.translation.translateString(msg); diff --git a/ayanova/src/api/gzdialog.js b/ayanova/src/api/gzdialog.js index 846535a1..aa5ce5c5 100644 --- a/ayanova/src/api/gzdialog.js +++ b/ayanova/src/api/gzdialog.js @@ -27,7 +27,10 @@ export default { msg, helpUrl ) { + //log full message window.$gz.store.commit("logItem", "notify-error: " + msg); + //trim really long message as it's likely useless beyond the first few lines (stack trace etc) + msg = msg.substring(0, 600); vm.$root.$gznotify({ message: msg, type: "error",