exception_object.ErrorCode Property

Sets and gets the number of the error message.

exception_object.ErrorCode =<new_value>
-or-
...exception_object.ErrorCode

Prerequisites

None

Parameters

None

Remarks

The ErrorCode property of an Exception is the primary value that indicates the type of exception that is represented by the exception_object.  This value can range from 4095 to -4095 and each utilized value has a text string associated with it for display purposes.  In most cases, the ErrorCode is further qualified by additional information such as a robot number, axis number or other information. To facilitate the interpretation of the ErrorCodes, positive values indicate success or warning conditions and negative numbers indicate an error of some type.  A value of 0 is the general success code. For a full listing of the defined ErrorCode values, please see the "System Error Codes" section of the PreciseFlex Library. When a New Exception is created, it defaults to a general Exception with an ErrorCode value of 0 (success).

Examples

Dim exc1 As New Exception       ' Create new general exception
exc1.ErrorCode = -786           ' *Project generated error*
exc1.Qualifier = 8              ' Specify the qualifier
Console.WriteLine(exc1.Message) ' *Project generated error*: 8

See Also

Exception Handling