Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions homeassistant/components/auth/indieauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from urllib.parse import urlparse, urljoin

import aiohttp
from aiohttp.client_exceptions import ClientError

from homeassistant.util.network import is_local

Expand Down Expand Up @@ -81,8 +80,22 @@ async def fetch_redirect_uris(hass, url):
if chunks == 10:
break

except (asyncio.TimeoutError, ClientError) as ex:
_LOGGER.error("Error while looking up redirect_uri %s: %s", url, ex)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the error message ex not descriptive enough?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no string version of ClientError sadly, so nothing is output for that bit.

except asyncio.TimeoutError:
_LOGGER.error("Timeout while looking up redirect_uri %s", url)
pass
except aiohttp.client_exceptions.ClientSSLError:
_LOGGER.error("SSL error while looking up redirect_uri %s", url)
pass
except aiohttp.client_exceptions.ClientOSError as ex:
_LOGGER.error("OS error while looking up redirect_uri %s: %s", url,
ex.strerror)
pass
except aiohttp.client_exceptions.ClientConnectionError:
_LOGGER.error(("Low level connection error while looking up "
"redirect_uri %s"), url)
pass
except aiohttp.client_exceptions.ClientError:
_LOGGER.error("Unknown error while looking up redirect_uri %s", url)
pass

# Authorization endpoints verifying that a redirect_uri is allowed for use
Expand Down