Errors, or exceptions, are bound to occur in any software application, even after extensive testing on various environments. Once the application is in production, the software is exposed to a higher load, proper or erroneous user inputs, system or network crashes, and other occurrences that would lead to an application crash if not handled properly.
The concept of exception management says that the system should continue working in the case of a catastrophic failure, and should log detailed information of the failure in the form of errors or an unhandled exception for further investigation.
As we are building an ASP.NET Core Web API application in this book, which will be mainly consumed by web or mobile clients, any exception should be gracefully handled by the web API so that the clients can continue to work.
In this chapter, we will learn...