Skip to content

Commit

Permalink
fixed logging for device command execution error when arguments are null
Browse files Browse the repository at this point in the history
  • Loading branch information
angelo.andreussi authored and Coduz committed Oct 16, 2023
1 parent a6c5733 commit 2d3682f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ public DeviceCommandOutput exec(KapuaId scopeId, KapuaId deviceId, DeviceCommand
try {
responseMessage = commandDeviceCallBuilder.send();
} catch (Exception e) {
LOG.error("Error while executing DeviceCommand {} with arguments {} for Device {}. Error: {}", commandInput.getCommand(), String.join(" ", commandInput.getArguments()), deviceId, e.getMessage(), e);
if (commandInput.getArguments() != null) {
LOG.error("Error while executing DeviceCommand {} with arguments {} for Device {}. Error: {}", commandInput.getCommand(), String.join(" ", commandInput.getArguments()), deviceId, e.getMessage(), e);
} else {
LOG.error("Error while executing DeviceCommand {} for Device {}. Error: {}", commandInput.getCommand(), deviceId, e.getMessage(), e);
}
throw e;
}

Expand Down

0 comments on commit 2d3682f

Please sign in to comment.