cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r638759 - /cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
Date Wed, 19 Mar 2008 09:39:08 GMT
Author: reinhard
Date: Wed Mar 19 02:39:07 2008
New Revision: 638759

URL: http://svn.apache.org/viewvc?rev=638759&view=rev
Log:
fix a rather obscure problem with per-pipeline error handlers:
  If there is a per-pipeline handler in the last! pipeline of a sitemap,
  it also handled ResourceNotFoundExceptions although it is not responsible for it.
The solution is to move throwing this exception outside of the catch section which is responsible
for catching pipeline errors.

Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java?rev=638759&r1=638758&r2=638759&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
Wed Mar 19 02:39:07 2008
@@ -60,7 +60,6 @@
     /** Optional sitemap parameters */
     protected Map parameters;
 
-
     /**
      * A constructor to receive the optional expires parameter
      * and optional parameters for the processing pipeline
@@ -130,7 +129,7 @@
         desc = this.executor.enteringPipeline(this, env.getObjectModel(), desc);
 
         context.inform(desc.type, desc.parameters);
-        
+
         try {
             if (this.errorHandlerHelper.isInternal()) {
                 // Set internal error handler in the pipeline
@@ -147,8 +146,6 @@
                 return false;
             }
 
-            throw new ResourceNotFoundException("No pipeline matched request: " +
-                                                env.getURIPrefix() + env.getURI());
 
         } catch (ConnectionResetException e) {
             // Will be reported by CocoonServlet, rethrowing
@@ -157,5 +154,10 @@
             // Invoke error handler
             return this.errorHandlerHelper.invokeErrorHandler(e, env, context);
         }
+
+        // if nothing has matched and it is the last pipeline, then it's the right time
+        // to throw an ResourceNotFoundException
+        throw new ResourceNotFoundException("No pipeline matched request: " +
+                        env.getURIPrefix() + env.getURI());
     }
 }



Mime
View raw message