Add script error handling

This commit is contained in:
muzam1l
2022-07-05 19:09:08 +05:30
parent 621482e2ee
commit 175b6266e8

View File

@@ -68,6 +68,13 @@ const generateHtmlTemplate = (code: string, data?: Record<string, any>) => {
var process = '${processString || "{}"}';
process = JSON.parse(process);
window.process = process
function windowErrorHandler(event) {
event.preventDefault() // to prevent automatically logging to console
console.error(event.error.toString())
}
window.addEventListener('error', windowErrorHandler);
</script>
<script type="module">