2018-04-21 22:33:06 +02:00
|
|
|
"""Core Exceptions."""
|
2022-11-08 19:38:55 +01:00
|
|
|
from collections.abc import Callable
|
2021-03-16 12:17:05 +01:00
|
|
|
|
|
|
|
|
2018-04-21 22:33:06 +02:00
|
|
|
class HassioError(Exception):
|
|
|
|
"""Root exception."""
|
|
|
|
|
2021-03-16 12:17:05 +01:00
|
|
|
def __init__(
|
|
|
|
self,
|
2022-08-16 14:33:23 +02:00
|
|
|
message: str | None = None,
|
|
|
|
logger: Callable[..., None] | None = None,
|
2021-03-16 12:17:05 +01:00
|
|
|
) -> None:
|
|
|
|
"""Raise & log."""
|
2021-03-20 13:17:53 +01:00
|
|
|
if logger is not None and message is not None:
|
2021-03-16 12:17:05 +01:00
|
|
|
logger(message)
|
2021-03-20 13:17:53 +01:00
|
|
|
|
|
|
|
# Init Base
|
|
|
|
if message is not None:
|
|
|
|
super().__init__(message)
|
|
|
|
else:
|
|
|
|
super().__init__()
|
2021-03-16 12:17:05 +01:00
|
|
|
|
2018-04-21 22:33:06 +02:00
|
|
|
|
|
|
|
class HassioNotSupportedError(HassioError):
|
|
|
|
"""Function is not supported."""
|
2018-04-22 09:59:43 +02:00
|
|
|
|
|
|
|
|
2020-12-03 12:24:32 +01:00
|
|
|
# JobManager
|
|
|
|
|
|
|
|
|
|
|
|
class JobException(HassioError):
|
|
|
|
"""Base job exception."""
|
|
|
|
|
|
|
|
|
2021-04-09 13:33:28 +02:00
|
|
|
class JobConditionException(JobException):
|
|
|
|
"""Exception happening for job conditions."""
|
|
|
|
|
|
|
|
|
2023-08-08 22:49:17 +02:00
|
|
|
class JobStartException(JobException):
|
|
|
|
"""Exception occurred starting a job on in current asyncio task."""
|
|
|
|
|
|
|
|
|
|
|
|
class JobNotFound(JobException):
|
|
|
|
"""Exception for job not found."""
|
|
|
|
|
|
|
|
|
2023-08-30 22:01:03 +02:00
|
|
|
class JobInvalidUpdate(JobException):
|
|
|
|
"""Exception for invalid update to a job."""
|
|
|
|
|
|
|
|
|
2023-08-08 22:49:17 +02:00
|
|
|
class JobGroupExecutionLimitExceeded(JobException):
|
|
|
|
"""Exception when job group execution limit exceeded."""
|
|
|
|
|
|
|
|
|
2018-07-20 16:55:48 +02:00
|
|
|
# HomeAssistant
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2018-07-20 16:55:48 +02:00
|
|
|
class HomeAssistantError(HassioError):
|
|
|
|
"""Home Assistant exception."""
|
|
|
|
|
|
|
|
|
|
|
|
class HomeAssistantUpdateError(HomeAssistantError):
|
|
|
|
"""Error on update of a Home Assistant."""
|
|
|
|
|
|
|
|
|
2020-10-13 11:02:54 +02:00
|
|
|
class HomeAssistantCrashError(HomeAssistantError):
|
|
|
|
"""Error on crash of a Home Assistant startup."""
|
|
|
|
|
|
|
|
|
2018-08-09 00:05:08 +02:00
|
|
|
class HomeAssistantAPIError(HomeAssistantError):
|
|
|
|
"""Home Assistant API exception."""
|
2018-07-20 16:55:48 +02:00
|
|
|
|
|
|
|
|
2018-08-09 00:05:08 +02:00
|
|
|
class HomeAssistantAuthError(HomeAssistantAPIError):
|
|
|
|
"""Home Assistant Auth API exception."""
|
2018-07-20 16:55:48 +02:00
|
|
|
|
|
|
|
|
2021-02-19 11:57:31 +01:00
|
|
|
class HomeAssistantWSError(HomeAssistantAPIError):
|
|
|
|
"""Home Assistant websocket error."""
|
|
|
|
|
|
|
|
|
|
|
|
class HomeAssistantWSNotSupported(HomeAssistantWSError):
|
|
|
|
"""Raise when WebSockets are not supported."""
|
|
|
|
|
|
|
|
|
2021-11-29 17:21:09 +01:00
|
|
|
class HomeAssistantWSConnectionError(HomeAssistantWSError):
|
|
|
|
"""Raise when the WebSocket connection has an error."""
|
|
|
|
|
|
|
|
|
2020-12-03 12:24:32 +01:00
|
|
|
class HomeAssistantJobError(HomeAssistantError, JobException):
|
|
|
|
"""Raise on Home Assistant job error."""
|
|
|
|
|
|
|
|
|
2019-04-05 12:13:44 +02:00
|
|
|
# Supervisor
|
|
|
|
|
|
|
|
|
|
|
|
class SupervisorError(HassioError):
|
|
|
|
"""Supervisor error."""
|
|
|
|
|
|
|
|
|
|
|
|
class SupervisorUpdateError(SupervisorError):
|
|
|
|
"""Supervisor update error."""
|
|
|
|
|
|
|
|
|
2021-03-31 12:15:42 +02:00
|
|
|
class SupervisorAppArmorError(SupervisorError):
|
|
|
|
"""Supervisor AppArmor error."""
|
|
|
|
|
|
|
|
|
2020-12-03 12:24:32 +01:00
|
|
|
class SupervisorJobError(SupervisorError, JobException):
|
|
|
|
"""Raise on job errors."""
|
|
|
|
|
|
|
|
|
2018-06-30 01:48:58 +02:00
|
|
|
# HassOS
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2018-06-30 01:48:58 +02:00
|
|
|
class HassOSError(HassioError):
|
|
|
|
"""HassOS exception."""
|
|
|
|
|
|
|
|
|
|
|
|
class HassOSUpdateError(HassOSError):
|
|
|
|
"""Error on update of a HassOS."""
|
|
|
|
|
|
|
|
|
2021-03-26 14:33:14 +01:00
|
|
|
class HassOSJobError(HassOSError, JobException):
|
2018-06-30 01:48:58 +02:00
|
|
|
"""Function not supported by HassOS."""
|
|
|
|
|
|
|
|
|
2021-09-20 12:52:51 +02:00
|
|
|
class HassOSDataDiskError(HassOSError):
|
|
|
|
"""Issues with the DataDisk feature from HAOS."""
|
|
|
|
|
|
|
|
|
2022-07-15 09:21:59 +02:00
|
|
|
# All Plugins
|
|
|
|
|
|
|
|
|
|
|
|
class PluginError(HassioError):
|
|
|
|
"""Plugin error."""
|
|
|
|
|
|
|
|
|
2022-08-09 17:44:35 +02:00
|
|
|
class PluginJobError(PluginError, JobException):
|
|
|
|
"""Raise on job error with plugin."""
|
|
|
|
|
|
|
|
|
2020-03-27 17:37:48 +01:00
|
|
|
# HaCli
|
|
|
|
|
|
|
|
|
2022-07-15 09:21:59 +02:00
|
|
|
class CliError(PluginError):
|
2020-03-27 17:37:48 +01:00
|
|
|
"""HA cli exception."""
|
|
|
|
|
|
|
|
|
2020-04-05 23:26:22 +02:00
|
|
|
class CliUpdateError(CliError):
|
2020-03-27 17:37:48 +01:00
|
|
|
"""Error on update of a HA cli."""
|
|
|
|
|
|
|
|
|
2022-08-09 17:44:35 +02:00
|
|
|
class CliJobError(CliError, PluginJobError):
|
|
|
|
"""Raise on job error with cli plugin."""
|
|
|
|
|
|
|
|
|
2020-09-11 16:05:57 +02:00
|
|
|
# Observer
|
|
|
|
|
|
|
|
|
2022-07-15 09:21:59 +02:00
|
|
|
class ObserverError(PluginError):
|
2020-09-11 16:05:57 +02:00
|
|
|
"""General Observer exception."""
|
|
|
|
|
|
|
|
|
|
|
|
class ObserverUpdateError(ObserverError):
|
|
|
|
"""Error on update of a Observer."""
|
|
|
|
|
|
|
|
|
2022-08-09 17:44:35 +02:00
|
|
|
class ObserverJobError(ObserverError, PluginJobError):
|
|
|
|
"""Raise on job error with observer plugin."""
|
|
|
|
|
|
|
|
|
2020-04-05 23:26:22 +02:00
|
|
|
# Multicast
|
|
|
|
|
|
|
|
|
2022-07-15 09:21:59 +02:00
|
|
|
class MulticastError(PluginError):
|
2020-04-05 23:26:22 +02:00
|
|
|
"""Multicast exception."""
|
|
|
|
|
|
|
|
|
|
|
|
class MulticastUpdateError(MulticastError):
|
|
|
|
"""Error on update of a multicast."""
|
|
|
|
|
|
|
|
|
2022-08-09 17:44:35 +02:00
|
|
|
class MulticastJobError(MulticastError, PluginJobError):
|
|
|
|
"""Raise on job error with multicast plugin."""
|
|
|
|
|
|
|
|
|
2019-08-13 14:20:42 +02:00
|
|
|
# DNS
|
|
|
|
|
|
|
|
|
2022-07-15 09:21:59 +02:00
|
|
|
class CoreDNSError(PluginError):
|
2019-08-13 14:20:42 +02:00
|
|
|
"""CoreDNS exception."""
|
|
|
|
|
|
|
|
|
|
|
|
class CoreDNSUpdateError(CoreDNSError):
|
|
|
|
"""Error on update of a CoreDNS."""
|
|
|
|
|
|
|
|
|
2022-08-09 17:44:35 +02:00
|
|
|
class CoreDNSJobError(CoreDNSError, PluginJobError):
|
|
|
|
"""Raise on job error with dns plugin."""
|
|
|
|
|
|
|
|
|
2022-07-15 09:21:59 +02:00
|
|
|
# Audio
|
2020-02-25 18:37:06 +01:00
|
|
|
|
|
|
|
|
2022-07-15 09:21:59 +02:00
|
|
|
class AudioError(PluginError):
|
2020-02-25 18:37:06 +01:00
|
|
|
"""PulseAudio exception."""
|
|
|
|
|
|
|
|
|
|
|
|
class AudioUpdateError(AudioError):
|
|
|
|
"""Error on update of a Audio."""
|
|
|
|
|
|
|
|
|
2022-08-09 17:44:35 +02:00
|
|
|
class AudioJobError(AudioError, PluginJobError):
|
|
|
|
"""Raise on job error with audio plugin."""
|
|
|
|
|
|
|
|
|
2019-04-05 12:13:44 +02:00
|
|
|
# Addons
|
|
|
|
|
|
|
|
|
|
|
|
class AddonsError(HassioError):
|
|
|
|
"""Addons exception."""
|
|
|
|
|
|
|
|
|
2020-08-14 14:06:46 +02:00
|
|
|
class AddonConfigurationError(AddonsError):
|
|
|
|
"""Error with add-on configuration."""
|
|
|
|
|
|
|
|
|
2019-04-05 12:13:44 +02:00
|
|
|
class AddonsNotSupportedError(HassioNotSupportedError):
|
|
|
|
"""Addons don't support a function."""
|
|
|
|
|
|
|
|
|
2020-12-03 12:24:32 +01:00
|
|
|
class AddonsJobError(AddonsError, JobException):
|
|
|
|
"""Raise on job errors."""
|
|
|
|
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
# Arch
|
|
|
|
|
|
|
|
|
|
|
|
class HassioArchNotFound(HassioNotSupportedError):
|
|
|
|
"""No matches with exists arch."""
|
|
|
|
|
|
|
|
|
2018-06-30 01:48:58 +02:00
|
|
|
# Updater
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2020-12-03 12:24:32 +01:00
|
|
|
class UpdaterError(HassioError):
|
2018-06-30 01:48:58 +02:00
|
|
|
"""Error on Updater."""
|
|
|
|
|
|
|
|
|
2020-12-03 12:24:32 +01:00
|
|
|
class UpdaterJobError(UpdaterError, JobException):
|
|
|
|
"""Raise on job error."""
|
|
|
|
|
|
|
|
|
2018-10-12 12:21:48 +02:00
|
|
|
# Auth
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2018-10-12 12:21:48 +02:00
|
|
|
class AuthError(HassioError):
|
|
|
|
"""Auth errors."""
|
|
|
|
|
|
|
|
|
2020-01-15 18:16:19 +01:00
|
|
|
class AuthPasswordResetError(HassioError):
|
2020-08-26 22:20:35 +02:00
|
|
|
"""Auth error if password reset failed."""
|
2020-01-15 18:16:19 +01:00
|
|
|
|
|
|
|
|
2018-04-23 21:10:48 +02:00
|
|
|
# Host
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2018-04-23 21:10:48 +02:00
|
|
|
class HostError(HassioError):
|
|
|
|
"""Internal Host error."""
|
|
|
|
|
|
|
|
|
|
|
|
class HostNotSupportedError(HassioNotSupportedError):
|
|
|
|
"""Host function is not supprted."""
|
|
|
|
|
|
|
|
|
2018-06-17 02:07:12 +02:00
|
|
|
class HostServiceError(HostError):
|
2020-08-26 22:20:35 +02:00
|
|
|
"""Host service functions failed."""
|
2018-06-17 02:07:12 +02:00
|
|
|
|
|
|
|
|
2018-06-20 00:09:18 +02:00
|
|
|
class HostAppArmorError(HostError):
|
2020-08-26 22:20:35 +02:00
|
|
|
"""Host apparmor functions failed."""
|
2018-08-16 22:49:08 +02:00
|
|
|
|
|
|
|
|
2020-11-09 08:56:42 +01:00
|
|
|
class HostNetworkError(HostError):
|
|
|
|
"""Error with host network."""
|
|
|
|
|
|
|
|
|
|
|
|
class HostNetworkNotFound(HostError):
|
|
|
|
"""Return if host interface is not found."""
|
|
|
|
|
|
|
|
|
2022-10-13 17:40:11 +02:00
|
|
|
class HostLogError(HostError):
|
|
|
|
"""Internal error with host log."""
|
|
|
|
|
|
|
|
|
2018-08-16 22:49:08 +02:00
|
|
|
# API
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2018-09-29 19:49:08 +02:00
|
|
|
class APIError(HassioError, RuntimeError):
|
2018-08-16 22:49:08 +02:00
|
|
|
"""API errors."""
|
|
|
|
|
|
|
|
|
2018-09-29 19:49:08 +02:00
|
|
|
class APIForbidden(APIError):
|
|
|
|
"""API forbidden error."""
|
|
|
|
|
|
|
|
|
2022-08-03 15:44:18 +02:00
|
|
|
class APIAddonNotInstalled(APIError):
|
|
|
|
"""Not installed addon requested at addons API."""
|
|
|
|
|
|
|
|
|
2018-09-29 19:49:08 +02:00
|
|
|
# Service / Discovery
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2018-09-29 19:49:08 +02:00
|
|
|
class DiscoveryError(HassioError):
|
|
|
|
"""Discovery Errors."""
|
|
|
|
|
|
|
|
|
|
|
|
class ServicesError(HassioError):
|
|
|
|
"""Services Errors."""
|
2018-06-20 00:09:18 +02:00
|
|
|
|
|
|
|
|
2021-10-18 23:06:44 +02:00
|
|
|
# utils/dbus
|
2018-04-22 09:59:43 +02:00
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2018-04-22 09:59:43 +02:00
|
|
|
class DBusError(HassioError):
|
2021-10-18 23:06:44 +02:00
|
|
|
"""D-Bus generic error."""
|
2018-04-22 09:59:43 +02:00
|
|
|
|
|
|
|
|
2018-04-26 11:33:43 +02:00
|
|
|
class DBusNotConnectedError(HostNotSupportedError):
|
2021-10-18 23:06:44 +02:00
|
|
|
"""D-Bus is not connected and call a method."""
|
2018-04-22 09:59:43 +02:00
|
|
|
|
|
|
|
|
2019-08-22 12:48:02 +02:00
|
|
|
class DBusInterfaceError(HassioNotSupportedError):
|
2021-10-18 23:06:44 +02:00
|
|
|
"""D-Bus interface not connected."""
|
2019-08-22 12:48:02 +02:00
|
|
|
|
|
|
|
|
2022-09-13 19:45:28 +02:00
|
|
|
class DBusObjectError(HassioNotSupportedError):
|
|
|
|
"""D-Bus object not defined."""
|
2018-04-22 09:59:43 +02:00
|
|
|
|
|
|
|
|
2021-09-20 12:52:51 +02:00
|
|
|
class DBusInterfaceMethodError(DBusInterfaceError):
|
2022-09-13 19:45:28 +02:00
|
|
|
"""D-Bus method not defined or input does not match signature."""
|
|
|
|
|
|
|
|
|
|
|
|
class DBusInterfacePropertyError(DBusInterfaceError):
|
|
|
|
"""D-Bus property not defined or is read-only."""
|
|
|
|
|
|
|
|
|
|
|
|
class DBusInterfaceSignalError(DBusInterfaceError):
|
|
|
|
"""D-Bus signal not defined."""
|
|
|
|
|
|
|
|
|
2018-04-22 09:59:43 +02:00
|
|
|
class DBusParseError(DBusError):
|
2021-10-18 23:06:44 +02:00
|
|
|
"""D-Bus parse error."""
|
2020-11-11 13:48:50 +01:00
|
|
|
|
|
|
|
|
2022-09-13 19:45:28 +02:00
|
|
|
class DBusTimeoutError(DBusError):
|
|
|
|
"""D-Bus call timed out."""
|
|
|
|
|
|
|
|
|
2023-05-01 08:45:52 +02:00
|
|
|
class DBusFatalError(DBusError):
|
|
|
|
"""D-Bus call going wrong.
|
|
|
|
|
|
|
|
Type field contains specific error from D-Bus for interface specific errors (like Systemd ones).
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
message: str | None = None,
|
|
|
|
logger: Callable[..., None] | None = None,
|
|
|
|
type_: str | None = None,
|
|
|
|
) -> None:
|
|
|
|
"""Initialize object."""
|
|
|
|
super().__init__(message, logger)
|
|
|
|
self.type = type_
|
|
|
|
|
|
|
|
|
|
|
|
# dbus/systemd
|
|
|
|
|
|
|
|
|
|
|
|
class DBusSystemdNoSuchUnit(DBusError):
|
|
|
|
"""Systemd unit does not exist."""
|
|
|
|
|
|
|
|
|
2018-06-20 00:09:18 +02:00
|
|
|
# util/apparmor
|
|
|
|
|
2019-01-31 18:47:44 +01:00
|
|
|
|
2018-06-20 00:09:18 +02:00
|
|
|
class AppArmorError(HostAppArmorError):
|
|
|
|
"""General AppArmor error."""
|
|
|
|
|
|
|
|
|
|
|
|
class AppArmorFileError(AppArmorError):
|
|
|
|
"""AppArmor profile file error."""
|
|
|
|
|
|
|
|
|
|
|
|
class AppArmorInvalidError(AppArmorError):
|
|
|
|
"""AppArmor profile validate error."""
|
2019-02-26 00:19:05 +01:00
|
|
|
|
|
|
|
|
2022-11-04 08:22:24 +01:00
|
|
|
# util/boards
|
|
|
|
|
|
|
|
|
|
|
|
class BoardInvalidError(DBusObjectError):
|
|
|
|
"""System does not use the board specified."""
|
|
|
|
|
|
|
|
|
2021-03-03 12:46:34 +01:00
|
|
|
# util/common
|
2019-02-26 00:19:05 +01:00
|
|
|
|
|
|
|
|
2021-03-03 12:46:34 +01:00
|
|
|
class ConfigurationFileError(HassioError):
|
|
|
|
"""Invalid JSON or YAML file."""
|
2021-02-28 20:00:02 +01:00
|
|
|
|
|
|
|
|
2021-03-03 12:46:34 +01:00
|
|
|
# util/json
|
2021-02-28 20:00:02 +01:00
|
|
|
|
|
|
|
|
2021-03-03 12:46:34 +01:00
|
|
|
class JsonFileError(ConfigurationFileError):
|
|
|
|
"""Invalid JSON file."""
|
2019-04-05 12:13:44 +02:00
|
|
|
|
|
|
|
|
2021-03-03 12:46:34 +01:00
|
|
|
# util/yaml
|
2021-03-01 12:26:43 +01:00
|
|
|
|
|
|
|
|
2021-03-03 12:46:34 +01:00
|
|
|
class YamlFileError(ConfigurationFileError):
|
|
|
|
"""Invalid YAML file."""
|
2021-03-01 12:26:43 +01:00
|
|
|
|
|
|
|
|
2021-02-25 09:37:45 +01:00
|
|
|
# util/pwned
|
|
|
|
|
|
|
|
|
|
|
|
class PwnedError(HassioError):
|
|
|
|
"""Errors while checking pwned passwords."""
|
|
|
|
|
|
|
|
|
2021-03-24 14:36:23 +01:00
|
|
|
class PwnedSecret(PwnedError):
|
|
|
|
"""Pwned secrets found."""
|
|
|
|
|
|
|
|
|
2021-03-07 11:47:46 +01:00
|
|
|
class PwnedConnectivityError(PwnedError):
|
|
|
|
"""Connectivity errors while checking pwned passwords."""
|
|
|
|
|
|
|
|
|
2021-03-19 08:40:35 +01:00
|
|
|
# util/codenotary
|
|
|
|
|
|
|
|
|
|
|
|
class CodeNotaryError(HassioError):
|
|
|
|
"""Error general with CodeNotary."""
|
|
|
|
|
|
|
|
|
|
|
|
class CodeNotaryUntrusted(CodeNotaryError):
|
|
|
|
"""Error on untrusted content."""
|
|
|
|
|
|
|
|
|
2021-03-24 14:36:23 +01:00
|
|
|
class CodeNotaryBackendError(CodeNotaryError):
|
|
|
|
"""CodeNotary backend error happening."""
|
|
|
|
|
|
|
|
|
2021-06-09 09:38:32 +02:00
|
|
|
# util/whoami
|
|
|
|
|
|
|
|
|
|
|
|
class WhoamiError(HassioError):
|
|
|
|
"""Error while using whoami."""
|
|
|
|
|
|
|
|
|
|
|
|
class WhoamiSSLError(WhoamiError):
|
|
|
|
"""Error with the SSL certificate."""
|
|
|
|
|
|
|
|
|
|
|
|
class WhoamiConnectivityError(WhoamiError):
|
|
|
|
"""Connectivity errors while using whoami."""
|
|
|
|
|
|
|
|
|
2019-04-05 12:13:44 +02:00
|
|
|
# docker/api
|
|
|
|
|
|
|
|
|
2020-09-15 14:54:18 +02:00
|
|
|
class DockerError(HassioError):
|
|
|
|
"""Docker API/Transport errors."""
|
|
|
|
|
|
|
|
|
|
|
|
class DockerAPIError(DockerError):
|
2019-04-05 12:13:44 +02:00
|
|
|
"""Docker API error."""
|
2019-09-02 14:07:09 +02:00
|
|
|
|
|
|
|
|
2020-09-15 14:54:18 +02:00
|
|
|
class DockerRequestError(DockerError):
|
|
|
|
"""Dockerd OS issues."""
|
|
|
|
|
|
|
|
|
2021-03-20 00:10:35 +01:00
|
|
|
class DockerTrustError(DockerError):
|
|
|
|
"""Raise if images are not trusted."""
|
|
|
|
|
|
|
|
|
2020-09-15 14:54:18 +02:00
|
|
|
class DockerNotFound(DockerError):
|
|
|
|
"""Docker object don't Exists."""
|
|
|
|
|
|
|
|
|
2023-08-08 22:49:17 +02:00
|
|
|
class DockerJobError(DockerError, JobException):
|
|
|
|
"""Error executing docker job."""
|
|
|
|
|
|
|
|
|
2019-09-02 14:07:09 +02:00
|
|
|
# Hardware
|
|
|
|
|
|
|
|
|
2021-01-28 15:26:56 +01:00
|
|
|
class HardwareError(HassioError):
|
|
|
|
"""General Hardware Error on Supervisor."""
|
|
|
|
|
|
|
|
|
|
|
|
class HardwareNotFound(HardwareError):
|
|
|
|
"""Hardware path or device doesn't exist on the Host."""
|
|
|
|
|
|
|
|
|
2019-09-02 14:07:09 +02:00
|
|
|
class HardwareNotSupportedError(HassioNotSupportedError):
|
|
|
|
"""Raise if hardware function is not supported."""
|
2020-02-26 11:48:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Pulse Audio
|
|
|
|
|
|
|
|
|
|
|
|
class PulseAudioError(HassioError):
|
|
|
|
"""Raise if an sound error is happening."""
|
2020-10-16 12:22:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Resolution
|
|
|
|
|
|
|
|
|
|
|
|
class ResolutionError(HassioError):
|
|
|
|
"""Raise if an error is happning on resoltuion."""
|
|
|
|
|
|
|
|
|
2021-03-12 11:32:56 +01:00
|
|
|
class ResolutionCheckError(ResolutionError):
|
|
|
|
"""Raise when there are an issue managing checks."""
|
|
|
|
|
|
|
|
|
2020-10-16 12:22:32 +02:00
|
|
|
class ResolutionNotFound(ResolutionError):
|
|
|
|
"""Raise if suggestion/issue was not found."""
|
2020-11-12 22:57:28 +01:00
|
|
|
|
|
|
|
|
2020-11-26 17:16:36 +01:00
|
|
|
class ResolutionFixupError(HassioError):
|
|
|
|
"""Rasie if a fixup fails."""
|
|
|
|
|
|
|
|
|
2020-12-03 21:06:48 +01:00
|
|
|
class ResolutionFixupJobError(ResolutionFixupError, JobException):
|
|
|
|
"""Raise on job error."""
|
|
|
|
|
|
|
|
|
2020-11-13 08:35:45 +01:00
|
|
|
# Store
|
|
|
|
|
|
|
|
|
|
|
|
class StoreError(HassioError):
|
|
|
|
"""Raise if an error on store is happening."""
|
|
|
|
|
|
|
|
|
|
|
|
class StoreGitError(StoreError):
|
|
|
|
"""Raise if something on git is happening."""
|
|
|
|
|
|
|
|
|
2022-05-23 09:16:42 +02:00
|
|
|
class StoreGitCloneError(StoreGitError):
|
|
|
|
"""Raise if error occurred while cloning repository."""
|
|
|
|
|
|
|
|
|
2020-11-28 15:03:44 +01:00
|
|
|
class StoreNotFound(StoreError):
|
|
|
|
"""Raise if slug is not known."""
|
2020-12-03 21:06:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
class StoreJobError(StoreError, JobException):
|
|
|
|
"""Raise on job error with git."""
|
2022-02-23 16:08:02 +01:00
|
|
|
|
|
|
|
|
2022-05-23 09:16:42 +02:00
|
|
|
class StoreInvalidAddonRepo(StoreError):
|
|
|
|
"""Raise on invalid addon repo."""
|
|
|
|
|
|
|
|
|
2022-02-23 16:08:02 +01:00
|
|
|
# Backup
|
|
|
|
|
|
|
|
|
|
|
|
class BackupError(HassioError):
|
|
|
|
"""Raise if an error during backup is happening."""
|
2022-04-07 20:37:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
class HomeAssistantBackupError(BackupError, HomeAssistantError):
|
|
|
|
"""Raise if an error during Home Assistant Core backup is happening."""
|
2022-04-30 10:14:43 +02:00
|
|
|
|
|
|
|
|
2023-09-09 10:54:19 +02:00
|
|
|
class BackupJobError(BackupError, JobException):
|
|
|
|
"""Raise on Backup job error."""
|
|
|
|
|
|
|
|
|
2022-04-30 10:14:43 +02:00
|
|
|
# Security
|
|
|
|
|
|
|
|
|
|
|
|
class SecurityError(HassioError):
|
|
|
|
"""Raise if an error during security checks are happening."""
|
|
|
|
|
|
|
|
|
|
|
|
class SecurityJobError(SecurityError, JobException):
|
|
|
|
"""Raise on Security job error."""
|
2023-05-01 08:45:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Mount
|
|
|
|
|
|
|
|
|
|
|
|
class MountError(HassioError):
|
|
|
|
"""Raise on an error related to mounting/unmounting."""
|
|
|
|
|
|
|
|
|
2023-05-02 08:33:01 +02:00
|
|
|
class MountActivationError(MountError):
|
|
|
|
"""Raise on mount not reaching active state after mount/reload."""
|
|
|
|
|
|
|
|
|
2023-05-01 08:45:52 +02:00
|
|
|
class MountInvalidError(MountError):
|
|
|
|
"""Raise on invalid mount attempt."""
|
|
|
|
|
|
|
|
|
|
|
|
class MountNotFound(MountError):
|
|
|
|
"""Raise on mount not found."""
|
2023-05-23 14:00:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
class MountJobError(MountError, JobException):
|
|
|
|
"""Raise on Mount job error."""
|
2023-07-06 22:26:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Network
|
|
|
|
|
|
|
|
|
|
|
|
class NetworkInterfaceNotFound(HassioError):
|
|
|
|
"""Raise on network interface not found."""
|