Chapter 10. Handling Exceptions and Errors
In This Chapter
try/catch Blocks
finally Blocks
Predefined Exception Classes
Handling Exceptions
Designing Your Own Exceptions
checked and unchecked Statements
This chapter discusses C# support for error handling and exceptions. Error handling is the technique of successfully trapping expected and unexpected runtime errors. The goal is to be able to anticipate errors before they occur. This makes a program more robust and promotes graceful degradation.
In C#, error handling is built around exceptions. Exceptions are special occurrences in a program that indicate an error condition. When an error occurs, an exception is thrown. The program should be constructed, using error-handling techniques, to catch
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access