Skip to content

Commit

Permalink
Core: Delete outdated onerror handler
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Dec 31, 2022
1 parent a8617fd commit 5d86bcf
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions code/lib/core-common/templates/base-preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,24 +326,4 @@
// eslint-disable-next-line no-console
console.warn('unable to connect to top frame for connecting dev tools');
}

window.onerror = function onerror(message, source, line, column, err) {
if (window.CONFIG_TYPE !== 'DEVELOPMENT') return;
// eslint-disable-next-line no-var, vars-on-top
var xhr = new window.XMLHttpRequest();
xhr.open('POST', '/runtime-error');
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xhr.send(
JSON.stringify({
/* eslint-disable object-shorthand */
message: message,
source: source,
line: line,
column: column,
error: err && { message: err.message, name: err.name, stack: err.stack },
origin: 'preview',
/* eslint-enable object-shorthand */
})
);
};
</script>

0 comments on commit 5d86bcf

Please sign in to comment.