core/homeassistant/exceptions.py

35 lines
759 B
Python
Raw Normal View History

"""The exceptions used by Home Assistant."""
class HomeAssistantError(Exception):
2016-03-07 23:06:04 +00:00
"""General Home Assistant exception occurred."""
pass
class InvalidEntityFormatError(HomeAssistantError):
2016-03-07 23:06:04 +00:00
"""When an invalid formatted entity is encountered."""
pass
class NoEntitySpecifiedError(HomeAssistantError):
2016-03-07 23:06:04 +00:00
"""When no entity is specified."""
pass
class TemplateError(HomeAssistantError):
2016-03-07 23:06:04 +00:00
"""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