Author: mes
Date: 2010-02-18 13:09:48 -0800 (Thu, 18 Feb 2010)
New Revision: 19371

Modified:
   cytoscape/trunk/src/cytoscape/logger/CyLogger.java
Log:
updated formatting of stack trace messages to properly recurse to the root 
exception

Modified: cytoscape/trunk/src/cytoscape/logger/CyLogger.java
===================================================================
--- cytoscape/trunk/src/cytoscape/logger/CyLogger.java  2010-02-18 21:01:11 UTC 
(rev 19370)
+++ cytoscape/trunk/src/cytoscape/logger/CyLogger.java  2010-02-18 21:09:48 UTC 
(rev 19371)
@@ -392,15 +392,17 @@
        }
 
        private String getStack(Throwable t) {
-               String message = null;
+               if ( t == null )
+                       return "";
+               String message = "\nCaused by:\n";
                if (t.getMessage() != null)
-                       message = t.getMessage() + "\n    "+t.toString();
+                       message += t.getMessage();
                else
-                       message = t.toString();
+                       message += t.toString();
                StackTraceElement[] stackArray = t.getStackTrace();
                for (int i = 0; stackArray != null && i < stackArray.length; 
i++) {
                        message += "\n      at "+stackArray[i].toString();
                }
-               return message;
+               return message + "\n" + getStack(t.getCause());
        }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to