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

Exception Class

Namespace

System

Createable

Yes

Description

The Exception class and its inherited (child) classes represent runtime exceptions.

Selected Exception Class Members

The following provides a brief description of the more important members of the Exception class:

HelpFile property

Sets or retrieves a link to the help file associated with the exception. Its value is a Uniform Resource Name (URN) or Uniform Resource Locator (URL).

InnerException property

Returns a reference to the inner Exception object in the case of nested exceptions.

Message property

Returns the text of the error message.

Source property

Returns or sets a string containing the name of the application or the object that causes the error.

StackTrace property

Returns a string (the stack trace) consisting of a list of all methods that are currently in the stack. The following shows a stack trace when the procedure DoArithmetic calls the procedure Arithmetic, which generates an exception that is thrown up to DoArithmetic (the string has been formatted to fit the margins of the page):

at WindowsApplication6.Form1.Arithmetic(String Action, Double x, 
Double y) in C:\Projects\WindowsApplication6\Form1.vb:line 68

at WindowsApplication6.Form1.DoArithmetic(  ) in 
C:\Projects\WindowsApplication6\Form1.vb:line 87
TargetSite property

Returns a MethodBase object representing the method that throws the exception. For example, if e is the exception whose stack trace is shown in the discussion of the StackTrace property, ...

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