Coverage for amqtt/errors.py: 100%
20 statements
« prev ^ index » next coverage.py v7.8.2, created at 2025-08-12 14:35 +0000
« prev ^ index » next coverage.py v7.8.2, created at 2025-08-12 14:35 +0000
1from typing import Any
4class AMQTTError(Exception):
5 """aMQTT base exception."""
8class MQTTError(Exception):
9 """Base class for all errors referring to MQTT specifications."""
12class CodecError(Exception):
13 """Exceptions thrown by packet encode/decode functions."""
16class NoDataError(Exception):
17 """Exceptions thrown by packet encode/decode functions."""
20class ZeroLengthReadError(NoDataError):
21 def __init__(self) -> None:
22 super().__init__("Decoding a string of length zero.")
25class BrokerError(Exception):
26 """Exceptions thrown by broker."""
29class PluginError(Exception):
30 """Exceptions thrown when loading or initializing a plugin."""
33class PluginImportError(PluginError):
34 """Exceptions thrown when loading plugin."""
37class PluginCoroError(PluginError):
38 """Exceptions thrown when loading a plugin with a non-async call method."""
41class PluginInitError(PluginError):
42 """Exceptions thrown when initializing plugin."""
44 def __init__(self, plugin: Any) -> None:
45 super().__init__(f"Plugin init failed: {plugin!r}")
48class ClientError(Exception):
49 """Exceptions thrown by client."""
52class ConnectError(ClientError):
53 """Exceptions thrown by client connect."""
55 return_code: int | None = None
58class ProtocolHandlerError(Exception):
59 """Exceptions thrown by protocol handle."""
62class PluginLoadError(Exception):
63 """Exception thrown when loading a plugin."""