JScript  

message Property

Returns an error message string.

errorObj.message

Arguments

errorObj
Required. Instance of Error object.

Remarks

The message property is a string containing an error message displayed to users. It contains the same information as the description property.

Example

The following example causes a TypeError exception to be thrown, and displays the name of the error and its message.

try {
  // 'null' is not a valid object
  null.doSomething();
}
catch(e){
  print(e.name + ": " + e.message);
  print(e.number + ": " + e.description);
}

Requirements

Version 5

See Also

description Property | name Property

Applies To: Error Object