© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
A. Troelsen, P. JapiksePro C# 9 with .NET 5https://doi.org/10.1007/978-1-4842-6939-8_7

7. Understanding Structured Exception Handling

Andrew Troelsen1   and Phillip Japikse2
(1)
Minneapolis, MN, USA
(2)
West Chester, OH, USA
 

In this chapter, you will learn how to handle runtime anomalies in your C# code through the use of structured exception handling. Not only will you examine the C# keywords that allow you to handle such matters (try, catch, throw, finally, when), but you will also come to understand the distinction between application-level and system-level exceptions, as well as the role of the System.Exception base class. This discussion will lead into the ...

Get Pro C# 9 with .NET 5: Foundational Principles and Practices in Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.