onyx-and-iris 242401e294 add VBANCMDPacketError to exception hierarchy
raise them when we fail to validate incoming packets.

add VbanRTRequestHeader post_init to validate the provided bps value.

VbanRTSubscribeHeader and VbanRTRequestHeader properties now return int type. They are then directly packed into the header.
2026-03-09 05:19:41 +00:00

19 lines
515 B
Python

from .packet.enums import ServiceTypes, SubProtocols
class VBANCMDError(Exception):
"""Base VBANCMD Exception class."""
class VBANCMDConnectionError(VBANCMDError):
"""Exception raised when connection/timeout errors occur"""
class VBANCMDPacketError(VBANCMDError):
"""Exception raised when packet parsing errors occur"""
def __init__(self, message: str, protocol: SubProtocols, type_: ServiceTypes):
super().__init__(message)
self.protocol = protocol
self.type = type_