log js errors
This commit is contained in:
parent
0e44e319c4
commit
695deb0947
2 changed files with 27 additions and 0 deletions
|
|
@ -1,6 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
(function() {
|
||||
window.onerror = function(error, url, line, column, errorObj) {
|
||||
if (error == 'TypeError: Attempted to assign to readonly property.') {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
var stack = (errorObj && errorObj.stack) || "(no stack trace available)";
|
||||
|
||||
!/^resource:/.test(url) && oml.api.logError({
|
||||
text: error + "\n\n" + stack,
|
||||
url: document.location.pathname + ' at ' + url,
|
||||
line: line
|
||||
});
|
||||
} catch(e) {}
|
||||
};
|
||||
|
||||
var animationInterval,
|
||||
enableDebugMode = getLocalStorage('oml.enableDebugMode'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue