You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jackson Chung (JIRA)" <ji...@apache.org> on 2011/06/07 20:03:58 UTC

[jira] [Updated] (CASSANDRA-2746) CliClient does not log root cause exception when catch it from executeCLIStatement

     [ https://issues.apache.org/jira/browse/CASSANDRA-2746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jackson Chung updated CASSANDRA-2746:
-------------------------------------

    Attachment: patch2746.txt

add initCause to exceptions caught from CliClient.executeCLIStatement

> CliClient does not log root cause exception when catch it from executeCLIStatement
> ----------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2746
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2746
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>         Attachments: patch2746.txt
>
>
> When executing a statement from the cassandra-cli (with --debug) , if an exception is thrown from one of the cases in side the executeCLIStatement method, the root cause is swallowed. For specific case such as the InvalidRequestException or the SchemaDisagreementException, just the message itself maybe enough, but for the general Exception case, without the root cause, it could be difficult to debug the issue. 
> For example, we have seen exception like:
> {noformat}
> null
> java.lang.RuntimeException
> at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:209)
> at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:223)
> at org.apache.cassandra.cli.CliMain.main(CliMain.java:351)
> {noformat}
> the null there would most likely indicate this is a NPE (though it could still be any Exception with null message). By adding a initCause to the caught exception, we could see the root cause, eg:
> {noformat}
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:212)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:223)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:351)
> Caused by: java.lang.NullPointerException
>         at org.apache.cassandra.cli.CliClient.describeKeySpace(CliClient.java:1336)
>         at org.apache.cassandra.cli.CliClient.executeShowKeySpaces(CliClient.java:1166)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:170)
>         ... 2 more
> {noformat}
> submitting a patch here that would add the initCause to all caught exceptions here. But the most important one is the general Exception case.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira