Retain original onerror handler.

pull/899/head
Marcel Klehr 2012-07-23 15:03:20 +02:00
parent c3dcb08a2c
commit 6f91facf49
1 changed files with 11 additions and 6 deletions

View File

@ -320,12 +320,17 @@
/* Display errors on page load to the user
(Gets overridden by padutils.setupGlobalExceptionHandler)
*/
window.onerror = function(msg, url, line) {
var box = document.getElementById('editorloadingbox');
box.innerHTML = '<p><b>An error occured while loading the pad</b></p>'
+ '<p><b>'+msg+'</b> '
+ '<small>in '+ url +' (line '+ line +')</small></p>'
};
(function() {
var originalHandler = window.onerror;
window.onerror = function(msg, url, line) {
var box = document.getElementById('editorloadingbox');
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 type="text/javascript" src="../static/js/require-kernel.js"></script>