Use builtin TimeoutError [a-d] (#109678)

This commit is contained in:
Marc Mueller
2024-02-05 11:31:33 +01:00
committed by GitHub
parent 41a256a3ff
commit c82933175d
63 changed files with 97 additions and 137 deletions

View File

@@ -55,7 +55,7 @@ _LOGGER = logging.getLogger(__name__)
_CLOUD_ERRORS: dict[type[Exception], tuple[HTTPStatus, str]] = {
asyncio.TimeoutError: (
TimeoutError: (
HTTPStatus.BAD_GATEWAY,
"Unable to reach the Home Assistant cloud.",
),
@@ -429,7 +429,7 @@ async def websocket_update_prefs(
try:
async with asyncio.timeout(10):
await alexa_config.async_get_access_token()
except asyncio.TimeoutError:
except TimeoutError:
connection.send_error(
msg["id"], "alexa_timeout", "Timeout validating Alexa access token."
)