basically you need to handle all errors. see docs:
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/handle-errors?view=aspnetcore-7.0
note: if you get a circuit error with a blazor server app, there is no real recovery other than reload, but you can use javascript to automate this.