ASP.NET Core equivalent of ASP.NET MVC 5’s HttpException
I implemented my own HttpException and supporting middleware which catches all HttpException‘s and turns them into the corresponding error response. A short extract can be seen below. You can also use the Boxed.AspNetCore Nuget package. Usage Example in Startup.cs public void Configure(IApplicationBuilder application) { application.UseIISPlatformHandler(); application.UseStatusCodePagesWithReExecute(“/error/{0}”); application.UseHttpException(); application.UseMvc(); } Extension Method public static class ApplicationBuilderExtensions … Read more