/[Apache-SVN]/cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java
ViewVC logotype

Diff of /cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java	2005/05/01 16:55:08	165524
+++ cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java	2005/05/01 17:10:25	165525
@@ -24,6 +24,7 @@ import org.apache.cocoon.components.tree
 import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.ProcessingNode;
 import org.apache.cocoon.environment.Environment;
+import org.apache.commons.lang.SystemUtils;
 
 /**
  * Handles <map:handle-errors>
@@ -94,32 +95,31 @@ public final class HandleErrorsNode exte
                     env.getObjectModel().remove(Constants.NOTIFYING_OBJECT);
                     throw new ProcessingException(
                         "Incomplete pipeline: 'handle-error' without a 'type' must include a generator, at " +
-                        getLocation() + System.getProperty("line.separator") +
+                        getLocation() + SystemUtils.LINE_SEPARATOR +
                         "Either add a generator (preferred) or a type='500' attribute (deprecated) on 'handle-errors'");
                 }
 
                 // Rethrow the exception
                 throw e;
             }
+		} else {
+		    // A 'type' attribute is present : add the implicit generator
+            context.getProcessingPipeline().setGenerator("<notifier>", "", Parameters.EMPTY_PARAMETERS, Parameters.EMPTY_PARAMETERS);
 
-		}
-	    // A 'type' attribute is present : add the implicit generator
-        context.getProcessingPipeline().setGenerator("<notifier>", "", Parameters.EMPTY_PARAMETERS, Parameters.EMPTY_PARAMETERS);
-
-        try {
-            return invokeNodes(this.children, env, context);
-        } catch (ProcessingException e) {
-            if (e.getMessage().indexOf("Generator already set") != -1){
-
-                env.getObjectModel().remove(Constants.NOTIFYING_OBJECT);
-                throw new ProcessingException(
-                        "Error: 'handle-error' with a 'type' attribute has an implicit generator, at " +
-                        getLocation() + System.getProperty("line.separator") +
-                        "Please remove the 'type' attribute on 'handle-error'");
-            }
+            try {
+                return invokeNodes(this.children, env, context);
+            } catch (ProcessingException e) {
+                if (e.getMessage().indexOf("Generator already set") != -1){
 
-            // Rethrow the exception
-            throw e;
+                    env.getObjectModel().remove(Constants.NOTIFYING_OBJECT);
+                    throw new ProcessingException(
+                            "Error: 'handle-error' with a 'type' attribute has an implicit generator, at " +
+                            getLocation() + SystemUtils.LINE_SEPARATOR +
+                            "Please remove the 'type' attribute on 'handle-error'");
+                }
+                // Rethrow the exception
+                throw e;
+            }
         }
     }
 }

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26