Do you present the user with a nice error screen?
Updated by Brady Stroud [SSW] 1 year ago. See history
Your users should never see the “yellow screen of death”. Errors should be caught, logged and a user-friendly screen displayed to the user.

❌ Figure: Bad Example – ASP.NET Yellow Screen of Death

❌ Figure: Bad Example - Default exception page

✅ Figure: Good Example - GitHub custom error page
However, as a developer you still want to be able to view the detail of the exception in your local development environment.
How-to set up development environment exception pages in ASP.NET Core
To set up exceptions in your local development environment you need to configure the Developer Exception Page middleware in the request processing pipeline. Unless you have modified the default template, it should work out of the box. Here are the important lines:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env){if (env.IsDevelopment()){app.UseDeveloperExceptionPage();}else{app.UseExceptionHandler("/Error");app.UseHsts();}...}

✅ Figure: This is how you set it up in .NET 5
Find out more about exception handling in .NET Core 5 here.