Retain original onerror handler.
parent
c3dcb08a2c
commit
6f91facf49
|
@ -320,12 +320,17 @@
|
||||||
/* Display errors on page load to the user
|
/* Display errors on page load to the user
|
||||||
(Gets overridden by padutils.setupGlobalExceptionHandler)
|
(Gets overridden by padutils.setupGlobalExceptionHandler)
|
||||||
*/
|
*/
|
||||||
window.onerror = function(msg, url, line) {
|
(function() {
|
||||||
var box = document.getElementById('editorloadingbox');
|
var originalHandler = window.onerror;
|
||||||
box.innerHTML = '<p><b>An error occured while loading the pad</b></p>'
|
window.onerror = function(msg, url, line) {
|
||||||
+ '<p><b>'+msg+'</b> '
|
var box = document.getElementById('editorloadingbox');
|
||||||
+ '<small>in '+ url +' (line '+ line +')</small></p>'
|
box.innerHTML = '<p><b>An error occured while loading the pad</b></p>'
|
||||||
};
|
+ '<p><b>'+msg+'</b> '
|
||||||
|
+ '<small>in '+ url +' (line '+ line +')</small></p>';
|
||||||
|
// call original error handler
|
||||||
|
if(typeof(originalHandler) == 'function') originalHandler.call(null, arguments);
|
||||||
|
};
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
|
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue