Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling. #10482

Merged
merged 3 commits into from Nov 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions homeassistant/components/influxdb.py
Expand Up @@ -5,9 +5,9 @@
https://home-assistant.io/components/influxdb/
"""
import logging

import re

import requests.exceptions
import voluptuous as vol

from homeassistant.const import (
Expand Down Expand Up @@ -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):
Expand Down