Skip to content

Fix/Improve processWindowErrorEvent #29407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web_src/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function processWindowErrorEvent(e) {
const assetBaseUrl = String(new URL(__webpack_public_path__, window.location.origin));

// error is likely from browser extension or inline script. Do not show these in production builds.
if (!err.stack?.includes(assetBaseUrl) && window.config?.runModeIsProd) return;
if (!err?.stack?.includes(assetBaseUrl) && window.config?.runModeIsProd) return;

let message;
if (e.type === 'unhandledrejection') {
Expand All @@ -49,6 +49,7 @@ function processWindowErrorEvent(e) {
}

showGlobalErrorMessage(`${message} Open browser console to see more details.`);
console.error(err ?? e);
}

function initGlobalErrorHandler() {
Expand Down