# Error Handling and Recovery ## Policy In the common interface, a failed operation returns `False`; details are available through `error_description` or `get_current_error_info()`. The current implementation does not directly obtain an RC8-style list of error codes from SDU Robotics `RTDEReceiveInterface`. Instead, it combines the last exception with the current safety status to construct synthetic error information. ## error_code ```python robot.error_code ``` Return 0 during normal operation, or a negative synthetic code on error. ## error_description ```python robot.error_description ``` Return the current error description. ## get_current_error_info() ```python info = robot.get_current_error_info() ``` Example: ```python { "code": -9006, "description": "...", "state": {...}, } ``` ## reset_error() ```python robot.reset_error() ``` Attempt to release a UR safety stop. When Dashboard is enabled, perform the following for a Protective Stop: - `closeSafetyPopup()` - `unlockProtectiveStop()` Execute `restartSafety()` for `fault` or `violation` only when `UR_ALLOW_RESTART_SAFETY=True`. ## turn_on_motor() ```python robot.turn_on_motor() ``` Call Dashboard `powerOn()` and `brakeRelease()`. ## turn_off_motor() ```python robot.turn_off_motor() ``` Call Dashboard `powerOff()`. ## Caution `reset_error()` is not equivalent to COBOTTA's `ClearError`. Recovery procedures differ for UR Protective Stops, Emergency Stops, and Faults. Do not automatically recover from a safety stop without first identifying its cause.