35 lines
709 B
JavaScript
35 lines
709 B
JavaScript
/* xeslint-disable */
|
|
import store from "../store";
|
|
|
|
function dealWithError(msg) {
|
|
store.commit("logItem", 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);
|
|
}
|
|
};
|