added general javascript error catch

pull/1033/head
Justin Richer 2016-02-12 17:32:35 -05:00
parent fc38a9f65d
commit cebf0fb8b2
2 changed files with 24 additions and 0 deletions

View File

@ -1014,6 +1014,18 @@ $(function () {
});
});
window.onerror = function ( message, filename, lineno, colno, error ){
//Display an alert with an error message
$('#modalAlert div.modal-header').html($.t('error.title'));
$('#modalAlert div.modal-body').html($.t('error.message') + ' <br /> ' [filename, lineno, colno, error]);
$("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog
"backdrop" : "static",
"keyboard" : true,
"show" : true // ensure the modal is shown immediately
});
}
});

View File

@ -1141,6 +1141,18 @@ $(function () {
});
});
window.onerror = function ( message, filename, lineno, colno, error ){
//Display an alert with an error message
$('#modalAlert div.modal-header').html($.t('error.title'));
$('#modalAlert div.modal-body').html($.t('error.message') + ' <br /> ' [filename, lineno, colno, error]);
$("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog
"backdrop" : "static",
"keyboard" : true,
"show" : true // ensure the modal is shown immediately
});
}
});