1
mirror of https://github.com/home-assistant/core synced 2024-07-12 07:21:24 +02:00
ha-core/homeassistant/exceptions.py
milanvo 7987065ad7 Fix recorder crash for long state string - enforce at core level (#9696)
* 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 9d6bd017d9.

* Revert - Recorder exception catch for long state string

* Fix state TypeError

* Test for long state exception
2017-10-25 09:05:30 -07:00

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