dotnet / dotnet/aspnetcore

ErrorBoundary support for multiple exceptions

Open
#38,905 19 comments 1 reaction 0 assignees View on GitHub
area-blazor enhancement feature-blazor-error-boundary
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

Am I using this incorrectly? I implemented as per [Documentation](https://docs.microsoft.com/en-us/aspnet/core/blazor/fundamentals/handle-errors?view=aspnetcore-6.0#error-boundaries) in `MainLayout.razor` with the slight change that in my `` section I added a button that triggers `errorBoundary?.Recover();`.

My test involved throwing a generic exception with a message from a child component in `protected override void OnInitialized()`. The result was that instead of displaying the content of `@Body` or the ErrorContent, there was nothing. Upon opening the browser inspector I had an empty ``.

I also tried creating a custom class that implemented ErrorBoundary, but this did not help either.

_Originally posted by @thirstyape in https://github.com/dotnet/aspnetcore/issues/30874#issuecomment-989263259_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.