2024-11-01 12:00:16 -07:00
|
|
|
class MeshCtrlError(Exception):
|
2024-11-05 22:21:35 -08:00
|
|
|
"""
|
|
|
|
|
Base class for Meshctrl errors
|
|
|
|
|
"""
|
2024-11-01 12:00:16 -07:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
class ServerError(MeshCtrlError):
|
2024-11-05 22:21:35 -08:00
|
|
|
"""
|
|
|
|
|
Represents an error thrown from the server
|
|
|
|
|
"""
|
2024-11-01 12:00:16 -07:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
class SocketError(MeshCtrlError):
|
2024-11-05 22:21:35 -08:00
|
|
|
"""
|
|
|
|
|
Represents an error in the websocket
|
|
|
|
|
"""
|
2024-11-20 15:23:03 -08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
class FileTransferError(MeshCtrlError):
|
|
|
|
|
"""
|
|
|
|
|
Represents a failed file transfer
|
|
|
|
|
|
|
|
|
|
Attributes:
|
|
|
|
|
stats (dict): {"result" (str): Human readable result, "size" (int): number of bytes successfully transferred}
|
|
|
|
|
"""
|
|
|
|
|
def __init__(self, message, stats):
|
|
|
|
|
self.stats = stats
|
|
|
|
|
|
|
|
|
|
class FileTransferCancelled(FileTransferError):
|
|
|
|
|
"""
|
|
|
|
|
Represents a canceled file transfer
|
|
|
|
|
"""
|
2024-11-05 22:21:35 -08:00
|
|
|
pass
|