Created
November 13, 2016 21:49
-
-
Save mstijak/715fa2dd3f495a98386c3ebbadbabb8c to your computer and use it in GitHub Desktop.
Revisions
-
mstijak created this gist
Nov 13, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ window.onerror = function (message, url, lineNo, colNo, error) { console.log(arguments); let container = document.createElement('div'); container.style.color = 'red'; container.style.position = 'fixed'; container.style.background = '#eee'; container.style.padding = '2em'; container.style.top = '1em'; container.style.left = '1em'; let msg = document.createElement('pre'); msg.innerText = [ 'Message: ' + message, 'URL: ' + url, 'Line: ' + lineNo, 'Column: ' + colNo, 'Stack: ' + (error && error.stack) ].join('\n'); container.appendChild(msg); document.body.appendChild(container); };