mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2026-03-12 04:59:09 +00:00
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.
19 lines
515 B
Python
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_
|