diff --git a/homeassistant/helpers/entity_platform.py b/homeassistant/helpers/entity_platform.py index 0d7614c569c..c8cc6979226 100644 --- a/homeassistant/helpers/entity_platform.py +++ b/homeassistant/helpers/entity_platform.py @@ -426,11 +426,12 @@ class EntityPlatform: type(exc).__name__, ) return False - except Exception: + except Exception as exc: logger.exception( - "Error while setting up %s platform for %s", + "Error while setting up %s platform for %s: %s", self.platform_name, self.domain, + exc, # noqa: TRY401 ) return False else: diff --git a/homeassistant/setup.py b/homeassistant/setup.py index 331389da7c6..1fa93a80cd5 100644 --- a/homeassistant/setup.py +++ b/homeassistant/setup.py @@ -425,8 +425,8 @@ async def _async_setup_component( ) return False # pylint: disable-next=broad-except - except (asyncio.CancelledError, SystemExit, Exception): - _LOGGER.exception("Error during setup of component %s", domain) + except (asyncio.CancelledError, SystemExit, Exception) as exc: + _LOGGER.exception("Error during setup of component %s: %s", domain, exc) # noqa: TRY401 async_notify_setup_error(hass, domain, integration.documentation) return False finally: diff --git a/tests/components/evohome/test_init.py b/tests/components/evohome/test_init.py index 49a854016ea..9b5fe6ad62d 100644 --- a/tests/components/evohome/test_init.py +++ b/tests/components/evohome/test_init.py @@ -25,7 +25,7 @@ SETUP_FAILED_ANTICIPATED = ( SETUP_FAILED_UNEXPECTED = ( "homeassistant.setup", logging.ERROR, - "Error during setup of component evohome", + "Error during setup of component evohome: ", ) AUTHENTICATION_FAILED = ( "homeassistant.components.evohome.helpers",