The .NET Framework provides a built in Exception class that you can use to catch almost all exceptions. You can also use this built-in class to derive new exception classes that have built-in support for a variety of fields. The Exception class provides the fields listed in Table 9-1 for you to use in your own exceptions.
|
Field |
Description |
|---|---|
|
StackTrace |
String that stores the current stack |
|
Message |
This property should be set with a descriptive error message |
|
HelpLink |
Contains a link to a help file |
|
HResult |
Gets or sets an error code |
|
Source |
Contains the name of the application or object that caused the error |
|
TargetSite |
Gets the method that throws the exception |