Author: kturner
Date: Fri Sep 21 22:31:35 2012
New Revision: 1388710
URL: http://svn.apache.org/viewvc?rev=1388710&view=rev
Log:
ACCUMULO-722 made shell insert always print errors
Modified:
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
Modified:
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
URL:
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java?rev=1388710&r1=1388709&r2=1388710&view=diff
==============================================================================
---
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
(original)
+++
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
Fri Sep 21 22:31:35 2012
@@ -93,6 +93,14 @@ public class InsertCommand extends Comma
for (ConstraintViolationSummary cvs :
e.getConstraintViolationSummaries()) {
lines.add(" " + cvs.toString());
}
+
+ if (lines.size() == 0 || e.getUnknownExceptions() > 0) {
+ // must always print something
+ lines.add(" " + e.getClass().getName() + " : " + e.getMessage());
+ if (e.getCause() != null)
+ lines.add(" Caused by : " + e.getCause().getClass().getName() + "
: " + e.getCause().getMessage());
+ }
+
shellState.printLines(lines.iterator(), false);
}
return 0;