This repository has been archived on 2023-06-10. You can view files and clone it, but cannot push or open issues or pull requests.
homeassistant-config/deps/lib/python3.10/site-packages/onvif/exceptions.py

39 lines
886 B
Python
Raw Permalink Normal View History

2023-02-11 18:37:07 +00:00
""" Core exceptions raised by the ONVIF Client """
# Error codes setting
# Error unknown, e.g, HTTP errors
ERR_ONVIF_UNKNOWN = 1
# Protocol error returned by WebService,
# e.g:DataEncodingUnknown, MissingAttr, InvalidArgs, ...
ERR_ONVIF_PROTOCOL = 2
# Error about WSDL instance
ERR_ONVIF_WSDL = 3
# Error about Build
ERR_ONVIF_BUILD = 4
class ONVIFError(Exception):
"""ONVIF Exception class."""
def __init__(self, err):
self.reason = "Unknown error: " + str(err)
self.code = ERR_ONVIF_UNKNOWN
super().__init__(err)
def __str__(self):
return self.reason
class ONVIFTimeoutError(ONVIFError):
"""ONVIF Timeout Exception class."""
def __init__(self, err):
super().__init__(err)
class ONVIFAuthError(ONVIFError):
"""ONVIF Authentication Exception class."""
def __init__(self, err):
super().__init__(err)