Skip to content
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

Add support for error boundaries in Blazor components #20210

Closed
captainsafia opened this issue Oct 15, 2020 · 0 comments
Closed

Add support for error boundaries in Blazor components #20210

captainsafia opened this issue Oct 15, 2020 · 0 comments

Comments

@captainsafia
Copy link
Member

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 dotnet/aspnetcore#13452 but I'm pulling it out into a separate issue to avoid conflating per-component exception handling with global exception handling.

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

  • Allow users to provide fallback UIs for select component subtrees in the event that there is an exception there
  • Allow users to build apps with cleaner fallback experiences in the event of unexpected UIs
  • Give users more fine-grained control over how failures are handled in the app

Non-goals

  • Implement any kind of global exception handling in Blazor (will leave that tracked in the issue above)
  • Add more sophisticated exception handling to the components in Blazor (besides the APIs needed to build this feature)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants