SadiJr commented on a change in pull request #5353:
URL: https://github.com/apache/cloudstack/pull/5353#discussion_r696550705



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -7686,4 +7533,20 @@ private GetVmVncTicketAnswer 
execute(GetVmVncTicketCommand cmd) {
             return new GetVmVncTicketAnswer(null, false, 
e.getLocalizedMessage());
         }
     }
-}
+
+    private String createLogMessageException(Throwable e, Command command) {
+        if (e instanceof RemoteException) {
+            s_logger.warn("Encounter remote exception to vCenter, invalidate 
VMware session context.");
+            invalidateServiceContext();
+        }
+
+        String message = String.format("%s failed due to [%s].", 
command.getClass().getSimpleName(), VmwareHelper.getExceptionMessage(e));
+        s_logger.error(message, e);
+
+        return message;
+    }
+
+    private void logInDebugCommand(Command cmd) {
+        s_logger.debug(String.format("Executing resource command %s: [%s].", 
cmd.getClass().getName(), getHumanReadableBytesJson(_gson.toJson(cmd))));

Review comment:
       I hadn't noticed it. Putting the log in the executeRequest method really 
simplified the code a lot. Thank you for the warning :).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to