Hi, I'm trying to implement global error handling in my blazor application using Telerik ErrorBoundary. Implementation is very simple in the MainLayout.razor I have this code
<ErrorBoundary @ref="errorBoundary">
<ChildContent>
@Body
</ChildContent>
<ErrorContent Context="ex">
@{
OpenNotification("Unhandled exception ocurred. Please try again later.", ThemeColor.Error, CloseAfter.Success);
// TODO: this code is called twice!
}
</ErrorContent>
</ErrorBoundary>
Open Notification it's a private method to show error message
private void OpenNotification(string text, string theme, int closeAfter)
{
Notification.Instance.Show(new NotificationModel
{
Text = text,
ThemeColor = theme,
CloseAfter = closeAfter
});
}
so when error happens notification is shown 2 times, I set console log in this code and it's logging two times execution.
Any idea what could be the problem?
Thanks