O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

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

Error Handling

Element

Description

Erl function

Indicates the line number at which an error occurred

Err.Clear method

Clears the Err object

Err.Description property

Provides a textual description of an error

Err.GetException method

Returns the Exception object associated with the current error

Err.HelpContext property

Returns or sets the help file ID for the current error

Err.HelpFile property

Returns or sets the name and path of the help file containing information about the current error

Err.LastDLLError property

Returns the error number from an error raised by a system API DLL

Err.Number property

Returns or sets the current error code

Err.Raise method

Generates a user-defined error

Err.Source property

Returns or sets the source of an error

ErrorToString function

Converts an error number to the corresponding error message

Exception class

Base class for all exceptions

IsError function

Determines whether an object is an exception type

On Error statement

Enables or disables an error handler

Resume statement

Transfers control from an error handler

Throw statement

Throws an exception

Try...Catch...Finally statement

Handles particular errors that may occur in a block of code through structured exception handling

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