Module pyControl4.error_handling
Handles errors recieved from the Control4 API.
Functions
- async def checkResponseForError(response_text: str)
- 
Checks a string response from the Control4 API for error codes. Parametersresponse_text- JSON or XML response from Control4, as a string.
Classes
- class BadCredentials (message)
- 
Raised when provided credentials are incorrect. Expand source codeclass BadCredentials(Unauthorized): """Raised when provided credentials are incorrect."""Ancestors- Unauthorized
- C4Exception
- builtins.Exception
- builtins.BaseException
 
- class BadToken (message)
- 
Raised when director bearer token is invalid. Expand source codeclass BadToken(Unauthorized): """Raised when director bearer token is invalid."""Ancestors- Unauthorized
- C4Exception
- builtins.Exception
- builtins.BaseException
 
- class C4Exception (message)
- 
Base error for pyControl4. Expand source codeclass C4Exception(Exception): """Base error for pyControl4.""" def __init__(self, message): self.message = messageAncestors- builtins.Exception
- builtins.BaseException
 Subclasses
- class InvalidCategory (message)
- 
Raised when an invalid category is provided when calling C4Director.getAllItemsByCategory().Expand source codeclass InvalidCategory(C4Exception): """Raised when an invalid category is provided when calling `pyControl4.director.C4Director.getAllItemsByCategory`."""Ancestors- C4Exception
- builtins.Exception
- builtins.BaseException
 
- class NotFound (message)
- 
Raised when a 404 response is recieved from the Control4 API. Occurs when the requested controller, etc. could not be found. Expand source codeclass NotFound(C4Exception): """Raised when a 404 response is recieved from the Control4 API. Occurs when the requested controller, etc. could not be found."""Ancestors- C4Exception
- builtins.Exception
- builtins.BaseException
 
- 
Raised when unauthorized, but no other recognized details are provided. Occurs when token is invalid. Expand source codeclass Unauthorized(C4Exception): """Raised when unauthorized, but no other recognized details are provided. Occurs when token is invalid."""Ancestors- C4Exception
- builtins.Exception
- builtins.BaseException
 Subclasses