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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights 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
DOI: https://doi.org/10.1007/978-1-4302-0160-1_7
Publisher Name: Apress
Print ISBN: 978-1-59059-578-7
Online ISBN: 978-1-4302-0160-1
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books