1
mirror of https://github.com/home-assistant/core synced 2024-09-09 12:51:22 +02:00
ha-core/homeassistant/exceptions.py

29 lines
648 B
Python
Raw Normal View History

2016-03-08 00:06:04 +01:00
"""Exceptions used by Home Assistant."""
class HomeAssistantError(Exception):
2016-03-08 00:06:04 +01:00
"""General Home Assistant exception occurred."""
pass
class InvalidEntityFormatError(HomeAssistantError):
2016-03-08 00:06:04 +01:00
"""When an invalid formatted entity is encountered."""
pass
class NoEntitySpecifiedError(HomeAssistantError):
2016-03-08 00:06:04 +01:00
"""When no entity is specified."""
pass
class TemplateError(HomeAssistantError):
2016-03-08 00:06:04 +01:00
"""Error during template rendering."""
def __init__(self, exception):
2016-03-08 00:06:04 +01:00
"""Initalize the error."""
super().__init__('{}: {}'.format(exception.__class__.__name__,
exception))