Common features in ASP.NET Core 2.1 WebApi: Error handling

added by DotNetKicks
1/2/2019 2:07:24 PM


The exception handling features help us deal with the unforeseen errors which could appear in our code. In ASP.NET Core we can handle errors in different manners : Error Handling with Try-Catch Block Error Handling with an Exception Filter Handling Errors Globally with the Built-In Middleware (UseExceptionHandler) Handling Errors Globally with the Custom Middleware In this article we will see how to handle errors with my favourite method: Custom Middleware.