You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by bi...@apache.org on 2011/11/22 01:18:30 UTC

svn commit: r1204760 - /incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java

Author: billie
Date: Tue Nov 22 00:18:30 2011
New Revision: 1204760

URL: http://svn.apache.org/viewvc?rev=1204760&view=rev
Log:
ACCUMULO-129 catch ClassCastException and explain

Modified:
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java?rev=1204760&r1=1204759&r2=1204760&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java Tue Nov 22 00:18:30 2011
@@ -120,7 +120,7 @@ public class SetIterCommand extends Comm
     shellState.getConnector().tableOperations().attachIterator(tableName, setting);
   }
   
-  private static String setUpOptions(ConsoleReader reader, String className, Map<String,String> options) throws IOException {
+  private static String setUpOptions(ConsoleReader reader, String className, Map<String,String> options) throws IOException, ShellCommandException {
     String input;
     OptionDescriber skvi;
     Class<? extends OptionDescriber> clazz;
@@ -133,6 +133,9 @@ public class SetIterCommand extends Comm
       throw new IllegalArgumentException(e.getMessage());
     } catch (IllegalAccessException e) {
       throw new IllegalArgumentException(e.getMessage());
+    } catch (ClassCastException e) {
+      throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, "Unable to load " + className + " as type " + OptionDescriber.class.getName()
+          + "; configure with 'config' instead");
     }
     
     IteratorOptions itopts = skvi.describeOptions();