get error from the browser using window object js code example Example: jsjs trigger window error window.setTimeout(function() {throw new Error()}, 0);