This commit is contained in:
2020-09-16 18:09:26 +00:00
parent f67379f83f
commit 425ef921e5
3 changed files with 16 additions and 3 deletions

View File

@@ -3,6 +3,12 @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
todo: exception handling around reports sucks 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 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 Test with dev mode off to confirm it won't show it in the UI

View File

@@ -1,18 +1,22 @@
/* xeslint-disable */ /* xeslint-disable */
let lastMessageHash = 0; let lastMessageHash = 0;
let lastMessageTimeStamp = new Date();
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// //
// translate, Log and optionally display errors // translate, Log and optionally display errors
// return translated message in case caller needs it // return translated message in case caller needs it
function dealWithError(msg, vm) { function dealWithError(msg, vm) {
//Check if this is the same message again as last time to avoid //Check if this is the same message again as last time within a short time span to avoid endless looping errors of same message
//repetitive loops of useless messages //but still allow for user to repeat operation that causes error so they can view it
let newHash = window.$gz.util.quickHash(msg); let newHash = window.$gz.util.quickHash(msg);
if (newHash == lastMessageHash) { 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; lastMessageHash = newHash;
lastMessageTimeStamp = new Date();
//translate as necessary //translate as necessary
msg = window.$gz.translation.translateString(msg); msg = window.$gz.translation.translateString(msg);

View File

@@ -27,7 +27,10 @@ export default {
msg, msg,
helpUrl helpUrl
) { ) {
//log full message
window.$gz.store.commit("logItem", "notify-error: " + msg); 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({ vm.$root.$gznotify({
message: msg, message: msg,
type: "error", type: "error",