1.1. What Is an Exception?

To signal that an error has occurred during program execution, the .NET CLR (Common Language Runtime) uses exceptions, which are objects that are thrown (instantiated and passed up the call stack) in response to runtime errors. A runtime error is one that changes or interrupts the normal flow of execution in a program.


You will often see the terms exception and error used interchangeably, although technically they are not the same thing. An error is simply any situation in which unwanted or unexpected results occur, while an exception is a specific object instantiated in response to a runtime error. However, as long as it's understood that you're talking about runtime errors, swapping these terms is usually not ...

Get Robust ASP.NET Exception Handling now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.