O'Reilly logo

Learning .NET High-performance Programming by Antonio Esposito

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exception handling

Exception handling is the black art of doing something to repair an unpredicted error or malfunction. Within CLR, anytime something happens outside our prevision, such as setting an Int16 typed variable with a value outside valid ranges, the CLR will handle such an event by itself, creating an instance of an Exception class and breaking the execution of our code, trying instead to find some other code able to handle (a.k.a catch) such an exception.

Any Exception class is populated with all useful details regarding what just happened, like a simplified error text (within the Message property), the StackTrace that explains exactly the whole method call hierarchy, and other details. Often, instead of a simple Exception class, an ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required