Difference between revisions of "Exception class"
Line 1: | Line 1: | ||
{{CGscriptClass_Template | {{CGscriptClass_Template | ||
|Name=<nowiki>Exception</nowiki> | |Name=<nowiki>Exception</nowiki> | ||
− | |Description=Represents an error object. This object can contain only non-user(system) thrown errors - the errors that not thrown by [[Exception Handling|throw expression]] | + | |Description=Represents an error object. This object can contain only non-user (system) thrown errors - the errors that not thrown by [[Exception Handling|throw expression]] |
|Methods= | |Methods= | ||
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} |
Revision as of 06:41, 20 December 2011
Exception
Represents an error object. This object can contain only non-user (system) thrown errors - the errors that not thrown by throw expression
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 its result:
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);
}