How to turn on CircuitOptions.DetailedErrors?

后端 未结 3 1842
北荒
北荒 2021-02-12 00:17

I\'m getting this message in the console when running a server-side Blazor app:

Error: There was an unhandled exception on the current circuit, so this

3条回答
  •  广开言路
    2021-02-12 01:03

    A better way to add detailed errors is to check your environment first. In Startup.cs add IWebHostEnvironment env to your constructor.

    Then you can do this:

    services.AddServerSideBlazor().AddCircuitOptions(o =>
    {
        if (_env.IsDevelopment()) //only add details when debugging
        {
            o.DetailedErrors = true;
        }
    });
    

提交回复
热议问题