Coverage for /Users/eugene/Development/robotnikmq/robotnikmq/error.py: 71%

1 class UnableToConnect(Exception):

2 def __str__(self):

3 return f"{self.__class__.__name__}: Robotnik is unable to connect: {self.args}"

4

5

6 class MalformedMessage(Exception):

7 def __init__(self, msg_input: str):

8 self.malformed_input = msg_input

9 super().__init__()

10

11 def __str__(self):

12 return f'Unable to decode RobotnikMQ message from: "{self.malformed_input}"'

13

14

15 class InvalidConfiguration(Exception):

16 def __str__(self):

17 return (

18 f"{self.__class__.__name__}: Robotnik is improperly configured: {self.args}"

19 )

20

21

22 class NotConfigured(Exception):

23 msg = "Robotnik is not configured"