mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-18 18:20:08 +00:00
2e528a8b12
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Simon Alibert <simon.alibert@huggingface.co> Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com>
29 lines
914 B
Python
29 lines
914 B
Python
class DeviceNotConnectedError(ConnectionError):
|
|
"""Exception raised when the device is not connected."""
|
|
|
|
def __init__(self, message="This device is not connected. Try calling `connect()` first."):
|
|
self.message = message
|
|
super().__init__(self.message)
|
|
|
|
|
|
class DeviceAlreadyConnectedError(ConnectionError):
|
|
"""Exception raised when the device is already connected."""
|
|
|
|
def __init__(
|
|
self,
|
|
message="This device is already connected. Try not calling `connect()` twice.",
|
|
):
|
|
self.message = message
|
|
super().__init__(self.message)
|
|
|
|
|
|
class InvalidActionError(ValueError):
|
|
"""Exception raised when an action is already invalid."""
|
|
|
|
def __init__(
|
|
self,
|
|
message="The action is invalid. Check the value follows what it is expected from the action space.",
|
|
):
|
|
self.message = message
|
|
super().__init__(self.message)
|