All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jangaroo-runtime.2.0.19.source-code.Error.as Maven / Gradle / Ivy

There is a newer version: 4.1.8
Show newest version
/**
 * API and documentation by Adobe?.
 * Licensed under http://creativecommons.org/licenses/by-nc-sa/3.0/
 */
package {

/**
 * The Error class contains information about an error that occurred in a script. In developing ActionScript 3.0 applications, when you run your compiled code in the debugger version of a Flash runtime, a dialog box displays exceptions of type Error, or of a subclass, to help you troubleshoot the code. You create an Error object by using the Error constructor function. Typically, you throw a new Error object from within a try code block that is caught by a catch or finally code block.
 * 

You can also create a subclass of the Error class and throw instances of that subclass.

*

View the examples

* @see http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7ecc.html Working with the debugger versions of Flash runtimes * @see http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7ed0.html Creating custom error classes * @see http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7ecf.html Responding to error events and status * */ [Native] public dynamic class Error { /** * Contains the reference number associated with the specific error message. For a custom Error object, this number is the value from the id parameter supplied in the constructor. */ public function get errorID():int { throw new Error('not implemented'); // TODO: implement! } /** * Contains the message associated with the Error object. By default, the value of this property is "Error". You can specify a message property when you create an Error object by passing the error string to the Error constructor function. * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#throw statements.html#throw * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#try..catch..finally statements.html#try..catch..finally * */ public var message :String; /** * Contains the name of the Error object. By default, the value of this property is "Error". * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#throw statements.html#throw * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#try..catch..finally statements.html#try..catch..finally * */ public var name:String; /** * Creates a new Error object. If message is specified, its value is assigned to the object's Error.message property. * @param message A string associated with the Error object; this parameter is optional. * @param id A reference number to associate with the specific error message. * * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#throw statements.html#throw * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#try..catch..finally statements.html#try..catch..finally * * @example The following example creates a new Error object err and then, using the Error() constructor, assigns the string "New Error Message" to err. * * var err:Error = new Error(); * trace(err.toString()); // Error * * err = new Error("New Error Message"); * trace(err.toString()); // Error: New Error Message * */ public native function Error(message : String = "", id:int = 0); /** * Returns the call stack for an error as a string at the time of the error's construction (for the debugger version of Flash Player and the AIR Debug Launcher (ADL) only; returns null if not using the debugger version of Flash Player or the ADL. As shown in the following example, the first line of the return value is the string representation of the exception object, followed by the stack trace elements: * * TypeError: null cannot be converted to an object * at com.xyz.OrderEntry.retrieveData(OrderEntry.as:995) * at com.xyz.OrderEntry.init(OrderEntry.as:200) * at com.xyz.OrderEntry.$construct(OrderEntry.as:148) * * @return A string representation of the call stack. * */ public function getStackTrace():String { throw new Error('not implemented'); // TODO: implement! } /** * Returns the string "Error" by default or the value contained in the Error.message property, if defined. * @return The error message. * * @see #message * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#throw statements.html#throw * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#try..catch..finally statements.html#try..catch..finally * * @example The following example creates a new Error object err and then, using the Error() constructor, assigns the string "New Error Message" to err. Finally, the message property is set to "Another New Error Message", which overwrites "New Error Message". * * var err:Error = new Error(); * trace(err.toString()); // Error * * err = new Error("New Error Message"); * trace(err.toString()); // Error: New Error Message * * err.message = "Another New Error Message"; * trace(err.toString()); // Error: Another New Error Message * */ public native function toString():String; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy