Improve timeout error handling for Splunk (#40384)

* Bugfix to catch asyncio.timeout

* Better asyncio.timeout warning message
This commit is contained in:
Brett 2020-09-22 11:01:52 +10:00 committed by GitHub
parent 7c344fa0cd
commit b3691d5d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,5 @@
"""Support to send data to a Splunk instance."""
import asyncio
import json
import logging
import time
@ -116,6 +117,8 @@ async def async_setup(hass, config):
_LOGGER.warning(err)
except ClientConnectionError as err:
_LOGGER.warning(err)
except asyncio.TimeoutError:
_LOGGER.warning("Connection to %s:%s timed out", host, port)
except ClientResponseError as err:
_LOGGER.error(err.message)

View File

@ -3,7 +3,7 @@
"name": "Splunk",
"documentation": "https://www.home-assistant.io/integrations/splunk",
"requirements": [
"hass_splunk==0.1.0"
"hass_splunk==0.1.1"
],
"codeowners": [
"@Bre77"

View File

@ -723,7 +723,7 @@ hangups==0.4.11
hass-nabucasa==0.37.0
# homeassistant.components.splunk
hass_splunk==0.1.0
hass_splunk==0.1.1
# homeassistant.components.jewish_calendar
hdate==0.9.5