JSFiddle - React, Tailwind, and code Playground
HTML
<button onclick="{">Make error</button>
JavaScript
window.onerror = function(message, url, line) {
// message - it is some description of this error
// url - it is url of script that cause error
// line - it is line number in script where error happen
console.log('error', message, url, line);
}