Please advice me any suitable solution for the following issue,
when the blazor application throws any exception, the whole application goes down and no link is working, until I can run the application through studio again.
what to do with this issue?
thanks & best regards
Edited
(In order to provide requested info)
Steps to reproduce:
Create a blazorserverside app:
Modify IncrementCount
At Counter.razor:
void IncrementCount()
{
currentCount += 1;
_ = 0 / (5-currentCount); // <-- force error when currentCount is 5.
}
Push
Click Mebutton for 5 times to raise error.Try to navigate to other app pages (Home, Fetch Data) nothing happens because it fails silently on client.
Additional info
On Startup.cs errors are configured:
app.UseExceptionHandler("/errors");
The stack trace errors:
Unhandled exception rendering component: Attempted to divide by zero.
System.DivideByZeroException: Attempted to divide by zero.
at blaex.Pages.Counter.IncrementCount() in /home/dani/tmp/blaex/Pages/Counter.razor:line 27
at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync[T](MulticastDelegate delegate, T arg)
at Microsoft.AspNetCore.Components.ComponentBase.Microsoft.AspNetCore.Components.IHandleEvent.HandleEventAsync(EventCallbackWorkItem callback, Object arg)
at Microsoft.AspNetCore.Components.Rendering.Renderer.DispatchEventAsync(Int32 eventHandlerId, UIEventArgs eventArgs)