1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-05-08 08:58:31 +01:00

Make plugin more robust (#1881)

This commit is contained in:
Pascal Vizeli
2020-08-10 13:23:50 +02:00
committed by GitHub
parent 4c5c6f072c
commit 7deed55c2d
+7 -2
View File
@@ -60,8 +60,9 @@ class PluginManager(CoreSysAttributes):
):
try:
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__)
self.sys_capture_exception(err)
# Check requirements
for plugin, required_version in (
@@ -95,6 +96,9 @@ class PluginManager(CoreSysAttributes):
type(plugin).__name__,
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:
"""Repair Supervisor plugins."""
@@ -122,5 +126,6 @@ class PluginManager(CoreSysAttributes):
):
try:
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__)
self.sys_capture_exception(err)