~carstengrohmann/OOMAnalyser

2c111144ccba215432e1b2420c8c43b92ab6ae6f — Carsten Grohmann 2 months ago f53e8c6
Report uncaught errors to the user
1 files changed, 18 insertions(+), 0 deletions(-)

M OOMAnalyser.html
M OOMAnalyser.html => OOMAnalyser.html +18 -0
@@ 205,6 205,23 @@ function read_and_display_file(file) {
    reader.readAsText(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>')}`

    let notify_box = document.getElementById('notify_box')
    notify_box.classList.remove('js-text--display-none')
    let notification = document.createElement('div')
    notification.classList.add('js-notify_box__msg--error')
    notification.innerHTML = text
    notify_box.appendChild(notification)

    // true - don't propagate the event to the default handler
    return true
};

    </script>
</head>
<body>


@@ 819,6 836,7 @@ function read_and_display_file(file) {
        <li>Add Selenium based unit tests</li>
        <li>Fix to allow process names with spaces</li>
        <li>Rework removal of unused information</li>
        <li>Report uncaught errors to the user</li>
        <li>...</li>
    </ol>