Skip to content
Snippets Groups Projects

Exception håndtering

The snippet can be accessed without any authentication.
Authored by Peter Ravnholt

Sæt exceptionhåndtering efter miljø.

Startup.cs 358 B
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    if (env.IsDevelopment())
    {
        // Ok to display sensitive tech details when developing
        app.UseDeveloperExceptionPage();
    }
    else
    {
        // Use a simple error page without technical details
        app.UseExceptionHandler("/error");
    }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment