Skip to content

Commit

Permalink
adopt reviewer suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Fiddian-Green <[email protected]>
  • Loading branch information
andrewfg committed Feb 6, 2025
1 parent 2e9c3a5 commit 9ad4aaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ public Set<ThingTypeUID> getSupportedThingTypeUIDs() {
logger.debug("SDDP discovered Gen {} hub/gateway '{}' on host '{}'", generation, thingUID,
device.ipAddress);
return hub;
} catch (HubException e) {
} catch (HubException | IllegalArgumentException e) {
logger.debug("Error discovering hub", e);
} catch (IllegalArgumentException e) {
// error already logged, so fall through
}
}
return null;
Expand Down Expand Up @@ -121,8 +119,6 @@ private int getGeneration(SddpDevice device) throws IllegalArgumentException {
if (device.type.contains(POWERVIEW_HUB_ID)) {
return device.type.endsWith("v2") ? 2 : 1;
}
final IllegalArgumentException e = new IllegalArgumentException("Device has unexpected 'type' property");
logger.debug("{}", e.getMessage());
throw e;
throw new IllegalArgumentException("Device has unexpected 'type' property");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public String getGenerationApiV1(String host) throws HubException {
}
throw new HubProcessingException("getGenerationApiV1(): HTTP error " + content.getReason());
} catch (JsonSyntaxException | InterruptedException | ExecutionException | TimeoutException e) {
throw new HubProcessingException("getSerialNumberApiV3(): " + e.getMessage(), e);
throw new HubProcessingException("getGenerationApiV1(): " + e.getMessage(), e);
}
}

Expand All @@ -105,7 +105,7 @@ public String getSerialNumberApiV1(String host) throws HubException {
}
throw new HubProcessingException("getSerialNumberApiV1(): " + content.getReason());
} catch (JsonSyntaxException | InterruptedException | ExecutionException | TimeoutException e) {
throw new HubProcessingException("getSerialNumberApiV3(): " + e.getMessage(), e);
throw new HubProcessingException("getSerialNumberApiV1(): " + e.getMessage(), e);
}
}

Expand Down

0 comments on commit 9ad4aaf

Please sign in to comment.