Skip to content

Commit

Permalink
more logs on MqttSensorService
Browse files Browse the repository at this point in the history
  • Loading branch information
toinux committed Dec 18, 2023
1 parent 0cc3739 commit b9b0e8b
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ public void handleHumidity(MqttMessage message) {
try {
humidity = Math.round((float) Double.parseDouble(new String(message.getPayload())));
} catch (Exception e) {
log.error("could not read humidity : {}", e.getMessage());
try {
log.error("could not read humidity : {}",new String(message.getPayload()), e);
} catch (Exception ee) {
log.error("could not read humidity",e);
}
}

}
Expand All @@ -44,7 +48,12 @@ public void handleTemperature(MqttMessage message) {
try {
temperature = Math.round((float) Double.parseDouble(new String(message.getPayload())));
} catch (Exception e) {
log.error("could not read temperature : {}", e.getMessage());
try {
log.error("could not read temperature : {}",new String(message.getPayload()), e);
} catch (Exception ee ) {
log.error("could not read temperature", e);
}

}
}
}

0 comments on commit b9b0e8b

Please sign in to comment.