Skip to main content

Understanding Structured Exception Handling

  • Chapter
Pro VB 2005 and the .NET 2.0 Platform
  • 206 Accesses

Summary

In this chapter, you examined the role of structured exception handling. When a method needs to send an error object to the caller, it will allocate, configure, and throw a specific System. Exception derived type via the VB 2005 Throw keyword. The caller is able to handle any possible incoming exceptions using the VB 2005 Try/Catch keywords and an optional Finally scope.

When you are creating your own custom exceptions, you ultimately create a class type deriving from System. ApplicationException, which denotes an exception thrown from the currently executing application. In contrast, error objects deriving from System. SystemException represent critical (and fatal) errors thrown by the CLR.

This chapter also illustrated various tools within Visual Studio 2005 that can be used to debug exceptions as they occur. Last but not least, I pointed out that the legacy VB 6.0 style of error handling (On Error) is still supported under Visual Basic 2005 for purposes of backwards compatibility.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Andrew Troelsen

About this chapter

Cite this chapter

(2006). Understanding Structured Exception Handling. In: Pro VB 2005 and the .NET 2.0 Platform. Apress. https://doi.org/10.1007/978-1-4302-0160-1_7

Download citation

Publish with us

Policies and ethics