# ErrorCode

When a requested task fails, an error code indicating which task fails and why it fails will be encoded into a negative integer in the result string and returned to the external device. Error Code consists of two parts: StepID (the upper four digits) and System Error Code (the lower four digits).

StepID is the stepID of requested task. System Error Code is a numbered code that determines the nature of an error and why it occurs.

Here is the table of System Error Code:

Error Type | System Error Code
--- | ---
None | -9999
TimeOut | -1000
UnKnownCommand | -1001
TooFewArguments | -1003
InvalidArgumentType | -1004
InvalidArgument | -1005
CommandNotAllowed | -1006
Busy | -1008
NotSupported | -1010
AcquisitionFailed | -1014
NotCalibrated | -2001
CalibrationFailed | -2002
InvalidCalibrationData | -2003
FeatureNotTrained | -3001
FeatureNotFound | -3002
LCheckFailed | -3006

ErrorCode is computed by the following equation:

ErrorCode = StepID * -10000 + System Error Code

For example, ErrorCode '-42003' means the error occurs in the task whose stepID is 4, and the cause of the error is that the task's calibration data is invalid.