Skip to content

Commit

Permalink
fixes influxdb exception message handling #87
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-Ricardo committed Jan 24, 2023
1 parent 964e1ce commit 2f0ce6f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fritzinfluxdb/classes/influxdb/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,17 @@ async def write_data(self):
write_successful = True
except (ApiException, InfluxDBClientError) as e:

exception_message = getattr(e, "message", "")
exception_message = None
http_code = 0
if isinstance(e, ApiException):
http_code = e.status
exception_message = e.message
if isinstance(e, InfluxDBClientError):
http_code = e.code
exception_message = e.content

if exception_message is None:
exception_message = str(e)

if "points beyond retention policy" in f"{exception_message}":

Expand Down

0 comments on commit 2f0ce6f

Please sign in to comment.