2017-04-30 05:04:49 +00:00
|
|
|
"""The exceptions used by Home Assistant."""
|
2015-08-30 01:11:24 +00:00
|
|
|
|
2015-08-30 02:34:35 +00:00
|
|
|
|
2015-08-30 01:11:24 +00:00
|
|
|
class HomeAssistantError(Exception):
|
2016-03-07 23:06:04 +00:00
|
|
|
"""General Home Assistant exception occurred."""
|
|
|
|
|
2015-08-30 01:11:24 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidEntityFormatError(HomeAssistantError):
|
2016-03-07 23:06:04 +00:00
|
|
|
"""When an invalid formatted entity is encountered."""
|
|
|
|
|
2015-08-30 01:11:24 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NoEntitySpecifiedError(HomeAssistantError):
|
2016-03-07 23:06:04 +00:00
|
|
|
"""When no entity is specified."""
|
|
|
|
|
2015-08-30 01:11:24 +00:00
|
|
|
pass
|
2015-12-12 03:07:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TemplateError(HomeAssistantError):
|
2016-03-07 23:06:04 +00:00
|
|
|
"""Error during template rendering."""
|
|
|
|
|
2015-12-12 03:07:03 +00:00
|
|
|
def __init__(self, exception):
|
2017-04-30 05:04:49 +00:00
|
|
|
"""Init the error."""
|
2015-12-12 03:07:03 +00:00
|
|
|
super().__init__('{}: {}'.format(exception.__class__.__name__,
|
|
|
|
exception))
|
2017-06-26 16:41:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PlatformNotReady(HomeAssistantError):
|
|
|
|
"""Error to indicate that platform is not ready."""
|
|
|
|
|
|
|
|
pass
|