Improve error handling. (#10482)
* Improve error handling. * Fix import of core requirements. * cleanuppull/10494/head
parent
dd16b7cac3
commit
37eae7fb8a
|
@ -5,9 +5,9 @@ For more details about this component, please refer to the documentation at
|
|||
https://home-assistant.io/components/influxdb/
|
||||
"""
|
||||
import logging
|
||||
|
||||
import re
|
||||
|
||||
import requests.exceptions
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import (
|
||||
|
@ -123,10 +123,12 @@ def setup(hass, config):
|
|||
try:
|
||||
influx = InfluxDBClient(**kwargs)
|
||||
influx.query("SHOW SERIES LIMIT 1;", database=conf[CONF_DB_NAME])
|
||||
except exceptions.InfluxDBClientError as exc:
|
||||
except (exceptions.InfluxDBClientError,
|
||||
requests.exceptions.ConnectionError) as exc:
|
||||
_LOGGER.error("Database host is not accessible due to '%s', please "
|
||||
"check your entries in the configuration file and that "
|
||||
"the database exists and is READ/WRITE.", exc)
|
||||
"check your entries in the configuration file (host, "
|
||||
"port, etc.) and verify that the database exists and is "
|
||||
"READ/WRITE.", exc)
|
||||
return False
|
||||
|
||||
def influx_event_listener(event):
|
||||
|
|
Loading…
Reference in New Issue