@@ 270,10 270,14 @@ function read_and_display_file(file) {
}
// Report uncaught errors to the user
-window.onerror = function (msg, url, lineNo, columnNo, error) {
- let text = `INTERNAL ERROR: ${msg} at ${url}:${lineNo}:${columnNo}<br> ` +
- `Details: ${error.__args__} <br>` +
- `${error.stack.replaceAll('\n', '<br>')}`
+window.onerror = function (msg, url, lineNo, columnNo, errorObj) {
+ let text = `INTERNAL ERROR:<br>${msg} at ${url}:${lineNo}:${columnNo}<br> `
+ if ('__args__' in errorObj && errorObj.__args__ !== undefined) {
+ text += `Details: ${errorObj.__args__} <br>`
+ }
+ if ('stack' in errorObj && errorObj.stack !== undefined) {
+ text += `Stack trace:</br>${errorObj.stack.replaceAll('\n', '<br>')}`
+ }
let notify_box = document.getElementById('notify_box')
notify_box.classList.remove('js-text--display-none')