remotivelabs.broker.exceptions

 1from dataclasses import dataclass
 2
 3
 4class BrokerError(Exception):
 5    """Raised for general RemotiveBroker errors"""
 6
 7
 8@dataclass
 9class BrokerLicenseError(BrokerError):
10    """Raised for license errors"""
11
12    host: str
13    message: str
14
15    def __str__(self):
16        return f"invalid license for broker at {self.host}: {self.message}"
17
18
19@dataclass
20class BrokerConnectionError(BrokerError):
21    """Raised for communication errors with a RemotiveBroker"""
22
23    host: str
24    message: str
25
26    def __str__(self):
27        return f"failed to connect to broker at {self.host}: {self.message}"
class BrokerError(builtins.Exception):
5class BrokerError(Exception):
6    """Raised for general RemotiveBroker errors"""

Raised for general RemotiveBroker errors

@dataclass
class BrokerLicenseError(BrokerError):
 9@dataclass
10class BrokerLicenseError(BrokerError):
11    """Raised for license errors"""
12
13    host: str
14    message: str
15
16    def __str__(self):
17        return f"invalid license for broker at {self.host}: {self.message}"

Raised for license errors

BrokerLicenseError(host: str, message: str)
host: str
message: str
@dataclass
class BrokerConnectionError(BrokerError):
20@dataclass
21class BrokerConnectionError(BrokerError):
22    """Raised for communication errors with a RemotiveBroker"""
23
24    host: str
25    message: str
26
27    def __str__(self):
28        return f"failed to connect to broker at {self.host}: {self.message}"

Raised for communication errors with a RemotiveBroker

BrokerConnectionError(host: str, message: str)
host: str
message: str