You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2008/08/27 17:56:27 UTC

svn commit: r689508 - /cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java

Author: reinhard
Date: Wed Aug 27 08:56:26 2008
New Revision: 689508

URL: http://svn.apache.org/viewvc?rev=689508&view=rev
Log:
unwrap runtime exceptions in order to be more specific in handle-error sections

Modified:
    cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java

Modified: cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java?rev=689508&r1=689507&r2=689508&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java (original)
+++ cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/InvocationImpl.java Wed Aug 27 08:56:26 2008
@@ -298,6 +298,13 @@
      * @see org.apache.cocoon.corona.sitemap.Invocation#setThrowable(java.lang.Throwable)
      */
     public void setThrowable(Throwable throwable) {
+        if (throwable instanceof RuntimeException) {
+            Throwable cause = throwable.getCause();
+            if (cause != null) {
+                throwable = cause;
+            }
+        }
+
         this.objectModel.getCoronaObject().put("exception", throwable);
         ParameterHelper.setThrowable(this.parameters, throwable);
     }