Source code for aiovlc.exceptions
"""Provide exceptions for aiovlc."""
from __future__ import annotations
[docs]
class AIOVLCError(Exception):
"""Represent a common error for aiovlc."""
[docs]
class ConnectError(AIOVLCError):
"""Represent a connection error for aiovlc."""
[docs]
class ConnectReadError(ConnectError):
"""The client failed to read."""
def __init__(self, error: Exception, partial_bytes: bytes | None = None) -> None:
"""Set up error."""
message = f"Failed to read: {error}."
if partial_bytes is not None:
message = f"{message} Partial bytes read: {partial_bytes!r}"
super().__init__(message)
self.partial_bytes = partial_bytes
[docs]
class AuthError(AIOVLCError):
"""Represent an authentication error."""
[docs]
class CommandError(AIOVLCError):
"""Represent a command error."""
[docs]
class CommandParameterError(CommandError):
"""Represent an error with a parameter when calling the command."""
[docs]
class CommandParseError(CommandError):
"""Represent an error when parsing the command output."""