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

Name

Err Object

Class

Microsoft.VisualBasic.ErrObject

Createable

No

Description

The Err object contains properties and methods that allow you to obtain information about a single runtime error in a Visual Basic program. The Err object also lets you generate errors and reset the error object. Because the Err object is an intrinsic object with global scope (which means that it is part of every VB project you create), you do not need to create an instance of it within your code.

When an error is generated in your application — whether it is handled or not — the properties of the Err object are assigned values that you can then access to gain information about the error that occurred. You can even generate your own errors explicitly using the Err.Raise method. You can also define your own errors to unify the error-handling process.

When your program reaches an Exit Function, Exit Sub, Exit Property, Resume, or On Error statement, the Err object is cleared and its properties reinitialized. This can also be done explicitly using the Err.Clear method.

Public Instance Properties

Property name

Description

Description

The string associated with the given error number

HelpContext

A context ID within a Visual Basic Help file

HelpFile

The path to a Visual Basic Help file

LastDLLError

The last error code generated by a DLL; available only on 32-bit Windows systems

Number

A long integer used to describe an error (i.e., an error code)

Source

Either the name of the current project or the ...

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