Summary
Exception handling is important but requires a level of experience when writing truly robust applications. Applications need to recover so that the user doesn’t have a jarring experience.
In this chapter, we learned about exception handling, when to use it, and where it makes sense, as well as performance considerations.
We ended this chapter by learning about the common techniques of exception handling by understanding the “prevention before exception” principle, why logging is important, and why exception handling is like unit testing.
We also learned that empty catch blocks are wasteful, how to simplify exceptions using exception filtering and pattern matching, when to use finally blocks, and how to rethrow exceptions properly.
In the next chapter, we’ll look at web API standards and how they are extremely important to the ASP.NET Core ecosystem.