1
mirror of https://github.com/home-assistant/core synced 2024-08-18 20:45:41 +02:00
ha-core/homeassistant/exceptions.py
Paulus Schoutsen 726bc5b670 Do not report on shutting down errors (#4431)
* Do not report on shutting down errors

* Lint
2016-11-17 12:02:43 -08:00

35 lines
759 B
Python

"""Exceptions used by Home Assistant."""
class HomeAssistantError(Exception):
"""General Home Assistant exception occurred."""
pass
class ShuttingDown(HomeAssistantError):
"""When trying to change something during shutdown."""
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):
"""Initalize the error."""
super().__init__('{}: {}'.format(exception.__class__.__name__,
exception))