mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00

* Recorder exception catch for long state string * Revert - Recorder exception catch for long state string * Validate state length at core level * Revert - this reverts commit 9d6bd017d96f20c10204d9bcb71573e3bc005ee3. * Revert - Recorder exception catch for long state string * Fix state TypeError * Test for long state exception
41 lines
864 B
Python
41 lines
864 B
Python
"""The exceptions used by Home Assistant."""
|
|
|
|
|
|
class HomeAssistantError(Exception):
|
|
"""General Home Assistant exception occurred."""
|
|
|
|
pass
|
|
|
|
|
|
class InvalidEntityFormatError(HomeAssistantError):
|
|
"""When an invalid formatted entity is encountered."""
|
|
|
|
pass
|
|
|
|
|
|
class NoEntitySpecifiedError(HomeAssistantError):
|
|
"""When no entity is specified."""
|
|
|
|
pass
|
|
|
|
|
|
class TemplateError(HomeAssistantError):
|
|
"""Error during template rendering."""
|
|
|
|
def __init__(self, exception):
|
|
"""Init the error."""
|
|
super().__init__('{}: {}'.format(exception.__class__.__name__,
|
|
exception))
|
|
|
|
|
|
class PlatformNotReady(HomeAssistantError):
|
|
"""Error to indicate that platform is not ready."""
|
|
|
|
pass
|
|
|
|
|
|
class InvalidStateError(HomeAssistantError):
|
|
"""When an invalid state is encountered."""
|
|
|
|
pass
|