-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add support for error boundaries in Blazor #26953
Copy link
Copy link
Closed
Labels
DoneThis issue has been fixedThis issue has been fixedPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseUser StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.affected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing oneseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseUser StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.affected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing oneseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
This proposes adding an error boundaries feature to Blazor, as inspired by the implementation in React. This feature would allow developers to implement logic on individual components to capture any excpetions, log, display a fallback UI, send telemetry, etc.
This feature was proposed in #13452 but I'm pulling it out into a separate issue to be more precise about the proposed solution.
Motivation
A meaningfully complex Blazor app will contain numerous components, both first-party and third-party. There's no way to guarantee that all exception cases will be handled in a component. There's also no way to indicate that even though an unhandled exception occurred in one part of the app, that the entire app is not compromised.
Goals
Non-goals
ILoggerfor logging, and beyond that, truly unhandled exceptions mean the app is in an undefined state which is unsafe to continue)