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.

NOTE

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 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.