Hour 11. Handling Errors Using Exceptions

As an application executes, it can encounter any number of possible error conditions. C# handles these error conditions using exceptions, which encapsulate the information about an error in a single class. Exceptions are intended to be used only for failure reporting, so they provide a consistent way to report and respond to those failures. Exceptions are not intended to provide a mechanism to control program flow, to report success conditions, or to be used as a ...

Get Sams Teach Yourself C# 5.0 in 24 Hours 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.