cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-10334) Inadequate information for handling catch clauses
Date Fri, 23 Mar 2018 14:02:00 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-10334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16411428#comment-16411428
] 

ASF GitHub Bot commented on CLOUDSTACK-10334:
---------------------------------------------

lzh3636 closed pull request #2509: CLOUDSTACK-10334: Inadequate information for handling catch
clauses
URL: https://github.com/apache/cloudstack/pull/2509
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java
index feefaabc551..72cfeb00571 100644
--- a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java
+++ b/server/src/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);
                 throw new CloudRuntimeException("Internal error initializing parameters for
command " + cmd.getCommandName() + " [field " + field.getName() +
                         " is not accessible]");
             } catch (final IllegalAccessException 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);
                 throw new CloudRuntimeException("Internal error initializing parameters for
command " + cmd.getCommandName() + " [field " + field.getName() +
                         " is not accessible]");
             }


 

----------------------------------------------------------------
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:
users@infra.apache.org


> Inadequate information for handling catch clauses
> -------------------------------------------------
>
>                 Key: CLOUDSTACK-10334
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10334
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>            Reporter: Zhenhao Li
>            Priority: Major
>              Labels: easyfix
>
> Their are some situations that different exception types are caught, but the handling
of those exceptions can not show the differences of those types. Here are the code snippets
we found which have this problem:
> *cloudstack/server/src/main/java/com/cloud/api/dispatch/ParamProcessWorker.java*
> [https://github.com/apache/cloudstack/blob/893a88d225276e45f12f9490e6af2c94a81c2965/server/src/main/java/com/cloud/api/dispatch/ParamProcessWorker.java]
> At Line *261* and Line *265.* We can see that two exception types are caught, but
the logging statements here can not show the exception type at all.
> Also they threw new exceptions after the logs, but the throw statements in these two
catch clauses are identical, which are not distinguishable.
> It may cause confusions to the person who is reading the log, the person can not know
what exception happened here and can not distinguish logs generated by these two statements.
>  Maybe adding stack trace information to these two logging statements and change the
log message to handle specific situations is a simple way to improve it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message