A Closer Look at Exception : Exception : Language Basics C# Examples


C# Examples » Language Basics » Exception »

 

A Closer Look at Exception






Message property contains a string that describes the nature of the error.
StackTrace property contains a string that contains the stack of calls that lead to the exception.
TargetSite property obtains an object that specifies the method that generated the exception.

System.Exception also defines several methods.

ToString() returns a string that describes the exception.
Exception defines four constructors.

The most commonly used are shown here:




    
Exception()
    Exception(string  str)
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Language Basics
» Exception