Skip to Content
VB.NET Language in a Nutshell, Second Edition
book

VB.NET Language in a Nutshell, Second Edition

by Steven Roman PhD, Ron Petrusha, Paul Lomax
April 2002
Intermediate to advanced
688 pages
19h 51m
English
O'Reilly Media, Inc.
Content preview from VB.NET Language in a Nutshell, Second Edition

Name

Err.Description Property

Class

Microsoft.VisualBasic.ErrObject

Syntax

To set the property:

Err.Description = string

To return the property value:

                  string = Err.Description
string (required; String)

Any string expression

Description

A read/write property containing a short string describing a runtime error

Rules at a Glance

  • When a runtime error occurs, the Description property is automatically assigned the standard description of the error.

  • For application-defined errors, you must assign a string expression to the Description property, or the error will not have an accompanying textual message.

  • You can override the standard description by assigning your own description to the Err object for both VB errors and application-defined errors.

Programming Tips and Gotchas

  • If an error occurs within a class module, an ActiveX DLL, or an EXE — regardless of whether it is running in or out of your application’s process space — no error information from the component will be available to your application unless you explicitly pass back an error code as part of the error-handling routine within the component. This is done using the Err.Raise method, which allows you to raise an error on the client, passing custom arguments for Number, Source, and Description.

  • If you raise an error with the Err.Raise method and do not set the Description property, the Description property will be automatically set to “Application- efined or Object-Defined Error.”

  • You can also pass the Err.Description to a logging ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

VB .NET Language in a Nutshell

VB .NET Language in a Nutshell

Steven Roman PhD, Ron Petrusha, Paul Lomax

Publisher Resources

ISBN: 0596003080Supplemental ContentCatalog PageErrata