Logging and reporting
ShadowJS does not log errors on its own; an ErrorBoundary shows its fallback and nothing else.
ShadowJS does not log errors on its own; an ErrorBoundary shows its fallback and nothing else. Send errors to your reporter in one of three places:
-
The fallback, for failures that are shown:
fallback={(error) => { report(error); return <Failed />; }}. The fallback is called once per error. -
A root handler, for everything no boundary caught.
catchErrorat the top of the tree sees errors from effects, memos and resources of the whole app: -
The browser, for handlers and promises:
window.addEventListener("error", ...)andwindow.addEventListener("unhandledrejection", ...).