cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r291117 - in /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util: location/LocatedException.java log/CocoonLogFormatter.java
Date Fri, 23 Sep 2005 13:46:34 GMT
Author: sylvain
Date: Fri Sep 23 06:46:29 2005
New Revision: 291117

URL: http://svn.apache.org/viewcvs?rev=291117&view=rev
Log:
Fix (hopefully) logging of stacktraces

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java?rev=291117&r1=291116&r2=291117&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/location/LocatedException.java
Fri Sep 23 06:46:29 2005
@@ -68,7 +68,7 @@
      * This is needed because some exceptions (e.g. SAXException) don't have a getCause()
that is
      * used to print stacktraces.
      */
-    static void ensureCauseChainIsSet(Throwable thr) {
+    public static void ensureCauseChainIsSet(Throwable thr) {
         if (INIT_CAUSE_METHOD == null)
             return;
         
@@ -79,7 +79,7 @@
                 try {
                     INIT_CAUSE_METHOD.invoke(thr, new Object[]{ parent });
                 } catch(Exception e) {
-                    // unlikely, so ignore
+                    // can happen if parent already set on exception
                 }
             }
             thr = parent;

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java?rev=291117&r1=291116&r2=291117&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java
Fri Sep 23 06:46:29 2005
@@ -20,6 +20,7 @@
 
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.util.location.LocatedException;
 
 import org.apache.commons.lang.ClassUtils;
 import org.apache.commons.lang.exception.ExceptionUtils;
@@ -289,7 +290,9 @@
      */
     protected String getStackTrace(final Throwable throwable, final String format) {
         if (throwable != null) {
-            return ExceptionUtil.printStackTrace(throwable, m_stackDepth);
+            LocatedException.ensureCauseChainIsSet(throwable);
+            return ExceptionUtils.getStackTrace(throwable);
+            //return ExceptionUtil.printStackTrace(throwable, m_stackDepth);
         }
 
         return null;



Mime
View raw message