lzh3636 commented on a change in pull request #2510: CLOUDSTACK-10334: Fix 
inadequate information for handling catch clauses
URL: https://github.com/apache/cloudstack/pull/2510#discussion_r176915843
 
 

 ##########
 File path: server/src/main/java/com/cloud/api/dispatch/ParamProcessWorker.java
 ##########
 @@ -258,11 +258,11 @@ public void processParameters(final BaseCmd cmd, final 
Map params) {
                 }
 
             } catch (final IllegalArgumentException e) {
-                s_logger.error("Error initializing command " + 
cmd.getCommandName() + ", field " + field.getName() + " is not accessible.");
+                s_logger.error("Error initializing command " + 
cmd.getCommandName() + ", field " + field.getName() + " is not accessible.", e);
 
 Review comment:
   Thanks for your reply. The exception is thrown by a new exception 
cloudruntime, but the original exception variable "e" is lost when throwing the 
new exception, so the logs will not show if the exception type is 
IllegalArgumentException or IllegalAccessException.
   
   It's true that it will be better to improve the log message, but I'm not so 
sure if I can change the message correctly. So it's a safe way to add original 
stack trace information here, at least we can know the true exception types 
from the logs generated without any harm.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to