O'Reilly logo

ASP.NET Developer's JumpStart by Ken Getz, Paul D. Sheriff

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

Throwing Exceptions

You may want to raise errors out of your procedures to indicate to callers that some exception has occurred. You might want to simply pass back a standard runtime exception provided by the .NET Framework, or you might want to create your own exception condition. In either case, you'll use the Throw keyword to raise the exception out of the current block.

NOTE

The Throw keyword works in much the same manner as the Err.Raise method in VB6.

Error-Handling Options

You can determine which exceptions you want to handle and which ones you want to raise back to your callers. When an exception occurs, your options include the following:

  • Do nothing at all. In this case, the .NET runtime will automatically raise the exception back out ...

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