Skip to content

Commit

Permalink
Fix exception handling for InfluxDB 1.x
Browse files Browse the repository at this point in the history
Fixes #16233

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
  • Loading branch information
jlaur committed Jan 7, 2024
1 parent c8d2d4b commit 5582b6b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBException;
import org.influxdb.InfluxDBFactory;
import org.influxdb.InfluxDBIOException;
import org.influxdb.dto.BatchPoints;
import org.influxdb.dto.Point;
import org.influxdb.dto.Pong;
Expand Down Expand Up @@ -129,7 +129,7 @@ public boolean write(List<InfluxPoint> influxPoints) {
BatchPoints batchPoints = BatchPoints.database(configuration.getDatabaseName())
.retentionPolicy(configuration.getRetentionPolicy()).points(points).build();
currentClient.write(batchPoints);
} catch (InfluxException | InfluxDBException e) {
} catch (InfluxException | InfluxDBIOException e) {
logger.debug("Writing to database failed", e);
return false;
}
Expand Down Expand Up @@ -175,7 +175,7 @@ public List<InfluxRow> query(FilterCriteria filter, String retentionPolicy) {
} else {
throw new InfluxException("API not present");
}
} catch (InfluxException | InfluxDBException e) {
} catch (InfluxException | InfluxDBIOException e) {
logger.warn("Failed to execute query '{}': {}", filter, e.getMessage());
return List.of();
}
Expand Down

0 comments on commit 5582b6b

Please sign in to comment.