Difference between revisions of "Exception class"

From Catglobe Wiki
Jump to: navigation, search
Line 12: Line 12:
 
}}
 
}}
 
Also see [[Exception_Handling|exception handling]] for more information.
 
Also see [[Exception_Handling|exception handling]] for more information.
 +
 +
==== <span style="color:#a52a2a;">'''Examples'''</span>  ====
 +
Type below script into the CGScript prompt to get it results:
 +
 +
<source lang="javascript">
 +
object e;
 +
try {
 +
      s = n;
 +
}
 +
catch(e) {
 +
    print("====e.ToString()======");
 +
    print(e.ToString());
 +
    print("\n====e.Message======");
 +
    print(e.Message);
 +
    print("\n====e.StackTrace======");
 +
    print(e.StackTrace);
 +
}
 +
</source>

Revision as of 04:27, 20 December 2011

Exception



Represents an error object.


Methods

  • string ToString() - The string representation of the object.

Properties

  • Exception InnerException { get; } - Gets the Exception instance that caused the current exception.
  • string Message { get; } - Gets a message that describes the current exception.
  • string ObjectTypeName { get; } - The name of the type of object.
  • string StackTrace { get; } - Return the internal stack trace, useful when sending a bugreport to Catglobe.
  • TypeInformation TypeInformation { get; } - Get information about this class.

Also see exception handling for more information.

Examples

Type below script into the CGScript prompt to get it results:

object e;
try {
      s = n;
} 
catch(e) {
    print("====e.ToString()======");
    print(e.ToString());
    print("\n====e.Message======");
    print(e.Message);
    print("\n====e.StackTrace======");
    print(e.StackTrace);
}