Catch CancelledError when setting up components (#88635)

* Catch CancelledError when setting up components

* Catch CancelledError when setting up components

* Also catch SystemExit
This commit is contained in:
Erik Montnemery 2023-02-27 15:29:14 +01:00 committed by GitHub
parent 198ebaff6e
commit 2c2489284b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -463,7 +463,8 @@ class ConfigEntry:
await self._async_process_on_unload()
return
except Exception: # pylint: disable=broad-except
# pylint: disable-next=broad-except
except (asyncio.CancelledError, SystemExit, Exception):
_LOGGER.exception(
"Error setting up entry %s for %s", self.title, integration.domain
)

View file

@ -264,7 +264,8 @@ async def _async_setup_component(
SLOW_SETUP_MAX_WAIT,
)
return False
except Exception: # pylint: disable=broad-except
# pylint: disable-next=broad-except
except (asyncio.CancelledError, SystemExit, Exception):
_LOGGER.exception("Error during setup of component %s", domain)
async_notify_setup_error(hass, domain, integration.documentation)
return False