Skip to content

Commit e45f18c

Browse files
author
Grégory Starck
committed
slightly better to raise a ValueError here.
1 parent c957248 commit e45f18c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

influxdb/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ def _write_points(self,
261261
database,
262262
retention_policy):
263263
if time_precision not in ['n', 'u', 'ms', 's', 'm', 'h', None]:
264-
raise Exception(
264+
raise ValueError(
265265
"Invalid time precision is given. "
266266
"(use 'n', 'u', 'ms', 's', 'm' or 'h')")
267267

268268
if self.use_udp and time_precision and time_precision != 's':
269-
raise Exception(
269+
raise ValueError(
270270
"InfluxDB only supports seconds precision for udp writes"
271271
)
272272

0 commit comments

Comments
 (0)