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 (Created) (JIRA)" <ji...@apache.org> on 2011/10/05 04:22:34 UTC

[jira] [Created] (CASSANDRA-3312) need initClause when catch Exception and throw new Exception in cli

need initClause when catch Exception and throw new Exception in cli
-------------------------------------------------------------------

                 Key: CASSANDRA-3312
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3312
             Project: Cassandra
          Issue Type: Bug
            Reporter: Jackson Chung
            Assignee: Pavel Yaskevich
            Priority: Minor


through CASSANDRA-2746 , we added initCause to the Cli such that we could see more meaningful exception stacktrace when certain exception is thrown.

However, there are still some other area, eg:

executeGetWithConditions(Tree)
executeSet(Tree)
executeIncr(Tree, long)
etc etc...

basically any time you do a
{code}
            {
                throw new RuntimeException(e.getMessage());
            }
{code}

the real exception is lost. The right approach should be:

{code}
        catch (Exception e)
        {
            throw new RuntimeException(e.getMessage(), e);
        }
{code}

eg: i was getting this:
null
java.lang.RuntimeException
        at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
        at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
        at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
Caused by: java.lang.RuntimeException
        at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
        at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
        ... 2 more


but i have no idea what the problem is with just the above stack trace.

with the fix, this would tell us more:
null
java.lang.RuntimeException
        at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
        at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
        at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
Caused by: java.lang.RuntimeException
        at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
        at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
        ... 2 more
Caused by: UnavailableException()
        at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_result.read(Cassandra.java:14065)
        at org.apache.cassandra.thrift.Cassandra$Client.recv_get_indexed_slices(Cassandra.java:810)
        at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:782)
        at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:806)
        ... 3 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3312) need initClause when catch Exception and throw new Exception in cli

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3312:
--------------------------------------

             Reviewer: xedin
    Affects Version/s:     (was: 1.0.1)
        Fix Version/s: 0.8.7

Tagging 0.8.7 because I *think* it's present there too.
                
> need initClause when catch Exception and throw new Exception in cli
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-3312
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3312
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: satish babu krishnamoorthy
>            Priority: Minor
>             Fix For: 0.8.7
>
>         Attachments: 3312.patch
>
>
> through CASSANDRA-2746 , we added initCause to the Cli such that we could see more meaningful exception stacktrace when certain exception is thrown.
> However, there are still some other area, eg:
> executeGetWithConditions(Tree)
> executeSet(Tree)
> executeIncr(Tree, long)
> etc etc...
> basically any time you do a
> {code}
>             {
>                 throw new RuntimeException(e.getMessage());
>             }
> {code}
> the real exception is lost. The right approach should be:
> {code}
>         catch (Exception e)
>         {
>             throw new RuntimeException(e.getMessage(), e);
>         }
> {code}
> eg: i was getting this:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> but i have no idea what the problem is with just the above stack trace.
> with the fix, this would tell us more:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> Caused by: UnavailableException()
>         at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_result.read(Cassandra.java:14065)
>         at org.apache.cassandra.thrift.Cassandra$Client.recv_get_indexed_slices(Cassandra.java:810)
>         at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:782)
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:806)
>         ... 3 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3312) need initClause when catch Exception and throw new Exception in cli

Posted by "satish babu krishnamoorthy (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

satish babu krishnamoorthy updated CASSANDRA-3312:
--------------------------------------------------

    Attachment: 3312.patch

Added patch to support more exceptional details
                
> need initClause when catch Exception and throw new Exception in cli
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-3312
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3312
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Jackson Chung
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>         Attachments: 3312.patch
>
>
> through CASSANDRA-2746 , we added initCause to the Cli such that we could see more meaningful exception stacktrace when certain exception is thrown.
> However, there are still some other area, eg:
> executeGetWithConditions(Tree)
> executeSet(Tree)
> executeIncr(Tree, long)
> etc etc...
> basically any time you do a
> {code}
>             {
>                 throw new RuntimeException(e.getMessage());
>             }
> {code}
> the real exception is lost. The right approach should be:
> {code}
>         catch (Exception e)
>         {
>             throw new RuntimeException(e.getMessage(), e);
>         }
> {code}
> eg: i was getting this:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> but i have no idea what the problem is with just the above stack trace.
> with the fix, this would tell us more:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> Caused by: UnavailableException()
>         at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_result.read(Cassandra.java:14065)
>         at org.apache.cassandra.thrift.Cassandra$Client.recv_get_indexed_slices(Cassandra.java:810)
>         at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:782)
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:806)
>         ... 3 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3312) need initClause when catch Exception and throw new Exception in cli

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13120881#comment-13120881 ] 

Hudson commented on CASSANDRA-3312:
-----------------------------------

Integrated in Cassandra-0.8 #362 (See [https://builds.apache.org/job/Cassandra-0.8/362/])
    Improved CLI exceptions
patch by satishbabu; reviewed by xedin for CASSANDRA-3312

xedin : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1179164
Files : 
* /cassandra/branches/cassandra-0.8/CHANGES.txt
* /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java

                
> need initClause when catch Exception and throw new Exception in cli
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-3312
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3312
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: satish babu krishnamoorthy
>            Priority: Minor
>             Fix For: 0.8.7
>
>         Attachments: 3312.patch
>
>
> through CASSANDRA-2746 , we added initCause to the Cli such that we could see more meaningful exception stacktrace when certain exception is thrown.
> However, there are still some other area, eg:
> executeGetWithConditions(Tree)
> executeSet(Tree)
> executeIncr(Tree, long)
> etc etc...
> basically any time you do a
> {code}
>             {
>                 throw new RuntimeException(e.getMessage());
>             }
> {code}
> the real exception is lost. The right approach should be:
> {code}
>         catch (Exception e)
>         {
>             throw new RuntimeException(e.getMessage(), e);
>         }
> {code}
> eg: i was getting this:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> but i have no idea what the problem is with just the above stack trace.
> with the fix, this would tell us more:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> Caused by: UnavailableException()
>         at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_result.read(Cassandra.java:14065)
>         at org.apache.cassandra.thrift.Cassandra$Client.recv_get_indexed_slices(Cassandra.java:810)
>         at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:782)
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:806)
>         ... 3 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CASSANDRA-3312) need initClause when catch Exception and throw new Exception in cli

Posted by "satish babu krishnamoorthy (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

satish babu krishnamoorthy reassigned CASSANDRA-3312:
-----------------------------------------------------

    Assignee: satish babu krishnamoorthy  (was: Pavel Yaskevich)
    
> need initClause when catch Exception and throw new Exception in cli
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-3312
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3312
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Jackson Chung
>            Assignee: satish babu krishnamoorthy
>            Priority: Minor
>         Attachments: 3312.patch
>
>
> through CASSANDRA-2746 , we added initCause to the Cli such that we could see more meaningful exception stacktrace when certain exception is thrown.
> However, there are still some other area, eg:
> executeGetWithConditions(Tree)
> executeSet(Tree)
> executeIncr(Tree, long)
> etc etc...
> basically any time you do a
> {code}
>             {
>                 throw new RuntimeException(e.getMessage());
>             }
> {code}
> the real exception is lost. The right approach should be:
> {code}
>         catch (Exception e)
>         {
>             throw new RuntimeException(e.getMessage(), e);
>         }
> {code}
> eg: i was getting this:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> but i have no idea what the problem is with just the above stack trace.
> with the fix, this would tell us more:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> Caused by: UnavailableException()
>         at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_result.read(Cassandra.java:14065)
>         at org.apache.cassandra.thrift.Cassandra$Client.recv_get_indexed_slices(Cassandra.java:810)
>         at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:782)
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:806)
>         ... 3 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3312) need initClause when catch Exception and throw new Exception in cli

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13120653#comment-13120653 ] 

Jonathan Ellis commented on CASSANDRA-3312:
-------------------------------------------

I think throw new RTE(e) would be fine, btw.
                
> need initClause when catch Exception and throw new Exception in cli
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-3312
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3312
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>
> through CASSANDRA-2746 , we added initCause to the Cli such that we could see more meaningful exception stacktrace when certain exception is thrown.
> However, there are still some other area, eg:
> executeGetWithConditions(Tree)
> executeSet(Tree)
> executeIncr(Tree, long)
> etc etc...
> basically any time you do a
> {code}
>             {
>                 throw new RuntimeException(e.getMessage());
>             }
> {code}
> the real exception is lost. The right approach should be:
> {code}
>         catch (Exception e)
>         {
>             throw new RuntimeException(e.getMessage(), e);
>         }
> {code}
> eg: i was getting this:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> but i have no idea what the problem is with just the above stack trace.
> with the fix, this would tell us more:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> Caused by: UnavailableException()
>         at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_result.read(Cassandra.java:14065)
>         at org.apache.cassandra.thrift.Cassandra$Client.recv_get_indexed_slices(Cassandra.java:810)
>         at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:782)
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:806)
>         ... 3 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3312) need initClause when catch Exception and throw new Exception in cli

Posted by "Sylvain Lebresne (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-3312:
----------------------------------------

    Fix Version/s:     (was: 0.8.8)
                   0.8.7
    
> need initClause when catch Exception and throw new Exception in cli
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-3312
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3312
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: satish babu krishnamoorthy
>            Priority: Minor
>             Fix For: 0.8.7
>
>         Attachments: 3312.patch
>
>
> through CASSANDRA-2746 , we added initCause to the Cli such that we could see more meaningful exception stacktrace when certain exception is thrown.
> However, there are still some other area, eg:
> executeGetWithConditions(Tree)
> executeSet(Tree)
> executeIncr(Tree, long)
> etc etc...
> basically any time you do a
> {code}
>             {
>                 throw new RuntimeException(e.getMessage());
>             }
> {code}
> the real exception is lost. The right approach should be:
> {code}
>         catch (Exception e)
>         {
>             throw new RuntimeException(e.getMessage(), e);
>         }
> {code}
> eg: i was getting this:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> but i have no idea what the problem is with just the above stack trace.
> with the fix, this would tell us more:
> null
> java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
>         at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
>         at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
> Caused by: java.lang.RuntimeException
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:815)
>         at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)
>         ... 2 more
> Caused by: UnavailableException()
>         at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_result.read(Cassandra.java:14065)
>         at org.apache.cassandra.thrift.Cassandra$Client.recv_get_indexed_slices(Cassandra.java:810)
>         at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:782)
>         at org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:806)
>         ... 3 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira