Use correct exception handler here
This commit is contained in:
@@ -8,7 +8,7 @@ import click
|
||||
import configparser
|
||||
from airthings import fetch_measurements, discover_devices
|
||||
from influxdb import InfluxDBClient
|
||||
from influxdb.exceptions import InfluxDBClientError
|
||||
from influxdb.exceptions import InfluxDBServerError
|
||||
|
||||
|
||||
def read_config(file):
|
||||
@@ -212,7 +212,7 @@ def start(ctx):
|
||||
try:
|
||||
client.write_points(data)
|
||||
click.echo("Sent!")
|
||||
except InfluxDBClientError as e:
|
||||
except InfluxDBServerError as e:
|
||||
click.echo("An error occured: %s" % e)
|
||||
click.echo("Storing data for now, waiting for the next interval." % e)
|
||||
click.echo("Sleeping for %s seconds" % interval)
|
||||
|
||||
Reference in New Issue
Block a user