Export (0) Print
Expand All

description Property

Returns or sets the descriptive string associated with a specific error.

object.description

object

Required. An instance of an Error object.

The description property is a string containing an error message associated with a specific error. Use the value contained in this property to alert a user to an error that the script cannot handle.

The description and message properties provide the same functionality; the description property provides backwards compatibility, while the message property complies with the ECMA standard.

The following example illustrates the use of the description property.

try
{
    var arr = new Array(-1);
}
catch(e)
{
    print ("Error Message: " + e.message);
    print ("Error Description: " + e.description);
    print ("Error Code: " + (e.number & 0xFFFF))
    print ("Error Name: " + e.name);
}

The output of this code is as follows.

Error Message: Array length must be zero or a positive integer
Error Description: Array length must be zero or a positive integer
Error Code: 5029
Error Name: RangeError

Community Additions

ADD
Show:
© 2014 Microsoft