[Swift-devel] [Swift-commit] r3835 - trunk/src/org/griphyn/vdl/karajan/functions (fwd)

Justin M Wozniak wozniak at mcs.anl.gov
Mon Jan 3 09:43:13 CST 2011


This looks right for end users, but for development it really helps to get 
a full stack trace.  Is it possible to turn on the full trace with a 
runtime option?
 	Justin

-- 
Justin M Wozniak

---------- Forwarded message ----------
Date: Fri, 31 Dec 2010 17:39:13
From: noreply at svn.ci.uchicago.edu
To: swift-commit at ci.uchicago.edu
Subject: [Swift-commit] r3835 - trunk/src/org/griphyn/vdl/karajan/functions

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;
  	}
  }

_______________________________________________
Swift-commit mailing list
Swift-commit at ci.uchicago.edu
http://mail.ci.uchicago.edu/mailman/listinfo/swift-commit



More information about the Swift-devel mailing list