This commit is contained in:
34
app/ayanova/src/utils/errorhandler.js
Normal file
34
app/ayanova/src/utils/errorhandler.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/* xeslint-disable */
|
||||
//import store from "../store";
|
||||
|
||||
function dealWithError(msg) {
|
||||
alert(msg);
|
||||
}
|
||||
export default {
|
||||
handleGeneralError(message, source, lineno, colno, error) {
|
||||
var msg = "GeneralError: \n" + message;
|
||||
if (source) {
|
||||
msg += "\nsource: " + source;
|
||||
}
|
||||
if (lineno) {
|
||||
msg += "\nlineno: " + lineno;
|
||||
}
|
||||
if (colno) {
|
||||
msg += "\ncolno: " + colno;
|
||||
}
|
||||
if (error) {
|
||||
msg += "\nerror: " + error;
|
||||
}
|
||||
dealWithError(msg);
|
||||
},
|
||||
handleVueError(err, vm, info) {
|
||||
var msg = "VueError: \n" + err;
|
||||
if (vm) {
|
||||
msg += "\nvm present ";
|
||||
}
|
||||
if (info) {
|
||||
msg += "\ninfo: " + info;
|
||||
}
|
||||
dealWithError(msg);
|
||||
}
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable */
|
||||
/* xeslint-disable */
|
||||
//////////////////////////////////////////////////////
|
||||
//in-memory log, keeps up to 100 of the past log items
|
||||
//
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
buffer.push(msg);
|
||||
store.commit("setLog", buffer.toArray());
|
||||
},
|
||||
getLogText(){
|
||||
getLogText() {
|
||||
//TODO: iterate the array from store, convert timestamps to local date and time and arrange as a block of multiline text to display in the UI
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user