Skip to content

Scenario · Errors

Errors

Each button produces a different kind of failure: in an event handler, after an await, while rendering, in a child's OnInitialized, from an HTTP call, the same failure with another id in its message each time, and two that only the browser sees - an image that does not load and a frame the page's Content Security Policy refuses. BevTools → Errors shows the type, message and stack of each, the component, and what happened right before it.

The failures

Throw during render and Child throws in OnInitialized happen inside an ErrorBoundary of their own on every renderer; Reset recovers it.

Live Renderer: Static · prerendering CtrlShiftD opens BevTools

Protected area

Nothing exploded (yet).

Errors: where it came from

The Errors panel lists each error with its source - where it was caught: a render, an ErrorBoundary, an HTTP call, a JS call, the browser or the framework's log - and its component. Select one for the rest: the stack trace, the source location (ErrorScenarios.razor and the line, from the app's symbols), the UI event that preceded it and the last ten timeline entries before it - the click, the renders and the requests that led there. The same error repeated within a minute is one row with a count.

Errors → Groups: one problem, many messages

Press Open a missing order three times (on Server, Recover in between). Each message names another order, so the list has three rows: Order 4711 was not found., Order 1302 was not found.… Groups shows them as one problem - Order {n} was not found. - with how many occurrences and different messages, the components and the source location; select it for its errors. Diagnostics reports a repeated error: … occurred 3 times with 3 different messages.

Failures only the browser sees

Load a missing image requests an address the server does not have, and Embed a frame the CSP forbids adds a frame that this site's Content Security Policy (frame-src 'none') refuses before anything is requested. Neither reaches .NET as an exception; the browser bridge reports both. Errors lists the first with source resource - Failed to load <img> and its address - and the second with source csp, naming the directive that refused it. In a real app these are a _framework file that did not load, or a policy without 'wasm-unsafe-eval' stopping Blazor WebAssembly.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.

An unhandled error has occurred. Reload 🗙