Take advantage of the UseExceptionHandler middleware in ASP.Net Core to ensure that every error in your Web API application is caught Exceptions are runtime errors ...
This article talks about the Developer Exception Page Middleware in ASP.NET Core MVC and how we can handle exceptions in both development and production environments in ASP.NET Core MVC applications.