Skip to content

Blazor - Error Boundary not triggered inside of EditForm Component #40649

@casper7526

Description

@casper7526

If you have the following:

<ErrorBoundary>
<ChildContent>
@Body
</ChildContent>
</ErrorBounday>

You expect that any exceptions within your pages will flow upwards and hit the errorbounday handling code. For 99% of things I have tried this holds true.

HOWEVER

If you trigger an exception while inside of Editforms methods (onSubmit,OnValidSubmit) you will bypass the errorboundary handler and be shown the default circuit error at the bottom of the screen.

<EditForm OnValidSubmit="OnSubmit"> .....

public void OnSubmit(){
throw new Exception("Error");
}

This seems to bypass the intended function of ErrorBoundary and while I am explaining it in a global manner it would still fail if it was done within a page itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions