The Wayback Machine - https://web.archive.org/web/20220127144126/https://github.com/dotnet/aspnetcore/issues/39814
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

Blazor doesn't render ErrorBoundary's ErrorContent when there are two different exceptions inside it's ChildContent #39814

Open
1 task done
xiety opened this issue Jan 27, 2022 · 0 comments

Comments

@xiety
Copy link

@xiety xiety commented Jan 27, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

ErrorBoundary renders nothing when there are two different errors inside it's ChildContent.

Expected Behavior

ErrorBoundary renders exception information.

Steps To Reproduce

App.razor

<ErrorBoundary>
    <ChildContent>
        <ComponentWithError />
    </ChildContent>
    <ErrorContent>
        <div style="background: red">@context</div>
    </ErrorContent>
</ErrorBoundary>

ComponentWithError.razor

@{
    throw new Exception("error2");
}

@code
{
    protected override async Task OnInitializedAsync()
    {
        throw new Exception("error");
    }
}

Exceptions (if any)

No response

.NET Version

6.0.101

Anything else?

I originally ran into this problem when I misspelled the parameter name in the inner component of ComponentWithError:
<ComponentWithoutProp BadProp=1 />
Which throws an exception by itself.

Also with exception inside void OnInitialized() everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant