mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
Make plugin more robust (#1881)
This commit is contained in:
parent
4c5c6f072c
commit
7deed55c2d
@ -60,8 +60,9 @@ class PluginManager(CoreSysAttributes):
|
|||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
await plugin.load()
|
await plugin.load()
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception as err: # pylint: disable=broad-except
|
||||||
_LOGGER.warning("Can't load plugin %s", type(plugin).__name__)
|
_LOGGER.warning("Can't load plugin %s", type(plugin).__name__)
|
||||||
|
self.sys_capture_exception(err)
|
||||||
|
|
||||||
# Check requirements
|
# Check requirements
|
||||||
for plugin, required_version in (
|
for plugin, required_version in (
|
||||||
@ -95,6 +96,9 @@ class PluginManager(CoreSysAttributes):
|
|||||||
type(plugin).__name__,
|
type(plugin).__name__,
|
||||||
required_version,
|
required_version,
|
||||||
)
|
)
|
||||||
|
except Exception as err: # pylint: disable=broad-except
|
||||||
|
_LOGGER.warning("Can't update plugin %s", type(plugin).__name__)
|
||||||
|
self.sys_capture_exception(err)
|
||||||
|
|
||||||
async def repair(self) -> None:
|
async def repair(self) -> None:
|
||||||
"""Repair Supervisor plugins."""
|
"""Repair Supervisor plugins."""
|
||||||
@ -122,5 +126,6 @@ class PluginManager(CoreSysAttributes):
|
|||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
await plugin.stop()
|
await plugin.stop()
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception as err: # pylint: disable=broad-except
|
||||||
_LOGGER.warning("Can't stop plugin %s", type(plugin).__name__)
|
_LOGGER.warning("Can't stop plugin %s", type(plugin).__name__)
|
||||||
|
self.sys_capture_exception(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user