[Swift-commit] r3835 - trunk/src/org/griphyn/vdl/karajan/functions
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Fri Dec 31 17:39:13 CST 2010
Author: skenny
Date: 2010-12-31 17:39:12 -0600 (Fri, 31 Dec 2010)
New Revision: 3835
Modified:
trunk/src/org/griphyn/vdl/karajan/functions/ProcessBulkErrors.java
Log:
don't show java exceptions, only the swift error
Modified: trunk/src/org/griphyn/vdl/karajan/functions/ProcessBulkErrors.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/functions/ProcessBulkErrors.java 2010-12-30 21:53:08 UTC (rev 3834)
+++ trunk/src/org/griphyn/vdl/karajan/functions/ProcessBulkErrors.java 2010-12-31 23:39:12 UTC (rev 3835)
@@ -90,31 +90,39 @@
}
public static String getMessageChain(Throwable e) {
+ Throwable orig = e;
StringBuffer sb = new StringBuffer();
String prev = null;
- boolean first = true;
+ String lastmsg = null;
+ boolean first = true;
while (e != null) {
String msg;
if (e instanceof NullPointerException || e instanceof ClassCastException) {
CharArrayWriter caw = new CharArrayWriter();
e.printStackTrace(new PrintWriter(caw));
msg = caw.toString();
+
}
else {
msg = e.getMessage();
+ if(msg != null){
+ lastmsg = msg;
+ }
+
}
if (msg != null && (prev == null || prev.indexOf(msg) == -1)) {
- if (!first) {
- sb.append("\nCaused by:\n\t");
- }
- else {
- first = false;
- }
- sb.append(msg);
- prev = msg;
+ if (!first) {
+ sb.append("\nCaused by:\n\t");
+ }
+ else {
+ first = false;
+ }
+ sb.append(msg);
+ lastmsg = msg;
+ prev = msg;
}
- e = e.getCause();
+ e = e.getCause();
}
- return sb.toString();
+ return lastmsg;
}
}
More information about the Swift-commit
mailing list