Skip to content

Commit

Permalink
Merge pull request #20462 from storybookjs/shilman/delete-outdated-on…
Browse files Browse the repository at this point in the history
…error

Core: Delete outdated onerror handler
  • Loading branch information
shilman authored Jan 1, 2023
2 parents 84c5dd1 + 5d86bcf commit 62ba7cf
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 62ba7cf

Please sign in to comment.