Author: jbellis
Date: Wed Jul  6 13:16:14 2011
New Revision: 1143397

URL: http://svn.apache.org/viewvc?rev=1143397&view=rev
Log:
add initCause to cliclient exceptions
patch by Jackson Chung; reviewed by jbellis for CASSANDRA-2746

Modified:
    
cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java

Modified: 
cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java?rev=1143397&r1=1143396&r2=1143397&view=diff
==============================================================================
--- 
cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java
 (original)
+++ 
cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java
 Wed Jul  6 13:16:14 2011
@@ -287,15 +287,21 @@ public class CliClient
         }
         catch (InvalidRequestException e)
         {
-            throw new RuntimeException(e.getWhy());
+               RuntimeException rtEx = new RuntimeException(e.getWhy());
+            rtEx.initCause(e);
+            throw rtEx;
         }
         catch (SchemaDisagreementException e)
         {
-            throw new RuntimeException("schema does not match across nodes, 
(try again later).");
+               RuntimeException rtEx = new RuntimeException("schema does not 
match across nodes, (try again later).");
+            rtEx.initCause(e);
+            throw new RuntimeException();
         }
         catch (Exception e)
         {
-            throw new RuntimeException(e.getMessage());
+            RuntimeException rtEx = new RuntimeException(e.getMessage());
+            rtEx.initCause(e);
+            throw rtEx;
         }
     }
 


Reply via email to