Skip to content

fix: log uncaught explore module errors with console.error#19489

Open
wlswo wants to merge 1 commit into
apache:masterfrom
wlswo:fix/explore-error-boundary-log-level
Open

fix: log uncaught explore module errors with console.error#19489
wlswo wants to merge 1 commit into
apache:masterfrom
wlswo:fix/explore-error-boundary-log-level

Conversation

@wlswo
Copy link
Copy Markdown
Contributor

@wlswo wlswo commented May 20, 2026

Description

ErrorBoundary.componentDidCatch in the explore view logs the uncaught render error through console.log:

componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
  console.log('Module content error:', error, errorInfo);
}

componentDidCatch is React's canonical error-reporting hook — by the
time it runs, an exception has already propagated up the render tree
and the subtree has been swapped out for the error-boundary fallback
UI. Logging at log severity:

  • hides the failure from the browser DevTools Errors filter
  • is invisible to tooling that watches console.error (test harnesses
    that fail on console errors, log scrapers, error-reporting SDKs)

Switching to console.error matches the severity at which other
sibling code in the same area logs caught-and-rethrown failures
(e.g. helpers/execution/sql-task-execution.ts's console.error on
the reports-endpoint retry path).

No other behavior change — the fallback UI rendering, state handling,
and React's own in-dev reportError path are untouched.

Release note

Uncaught render errors in explore-view modules are now logged at
console.error severity from the error boundary, matching the browser
DevTools "Errors" filter and any tooling that watches for
console.error.

Key changed/added classes in this PR
  • web-console/src/views/explore-view/components/error-boundary/error-boundary.tsx

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors. (N/A — internal log-severity fix, no user-facing docs)
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. (N/A — TypeScript)
  • added or updated version, license, or notice information in licenses.yaml (N/A — no dependency change)
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. (N/A — one-line severity fix)
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met. (no new code path — only the console method changes; the existing fallback-UI render path is unchanged)
  • added integration tests. (N/A)
  • been tested in a test Druid cluster. (N/A — verified by inspection: componentDidCatch is React's documented error-reporting hook; the catch handler runs only when the subtree has already thrown.)

`ErrorBoundary.componentDidCatch` in the explore view logs the uncaught
render error through `console.log`:

    componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
      console.log('Module content error:', error, errorInfo);
    }

`componentDidCatch` is React's canonical error-reporting hook — by the
time it runs, an exception has already propagated up the render tree
and the subtree has been swapped out for the fallback UI. Logging it at
`log` severity hides the failure from the browser DevTools "Errors"
filter and from any tooling (test harnesses, CI log scrapers, error
reporters) that watches `console.error`.

Switch to `console.error` so uncaught errors in explore modules are
surfaced at the appropriate severity. No other behavior change.
Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the code for correctness, edge cases, concurrency, and integration risks; no issues found.

Reviewed 1 of 1 changed files.


This is an automated review by Codex GPT-5.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants