Further improve IndieAuth redirect_uri lookup failure logs (#23183)

pull/23196/head
Robbie Trencheny 2019-04-18 09:03:25 -07:00 committed by Paulus Schoutsen
parent 4ac9a2e9de
commit 5e1338a9e4
1 changed files with 16 additions and 3 deletions

View File

@ -6,7 +6,6 @@ from html.parser import HTMLParser
from urllib.parse import urlparse, urljoin
import aiohttp
from aiohttp.client_exceptions import ClientError
from homeassistant.util.network import is_local
@ -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)
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