Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

Err.GetException Method

Class

Microsoft.VisualBasic.ErrObject

Syntax

Dim result As System.Exception = Err.GetException( )

Description

The GetException method returns the System.Exception object associated with the current error.

Usage at a Glance

  • If there is no exception, the method returns Nothing.

  • An Exception object is automatically supplied when using structured exception handling (the try...Catch...Finally statement), but the traditional Visual Basic error-handling code relies on the Err object. The GetException method lets you use elements of both types of error handling.

Version Differences

The GetException method is new to VB under .NET.

See Also

Err Object, Exception Class

Категории