You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bl...@apache.org on 2005/09/30 15:55:44 UTC

svn commit: r292734 - in /cocoon/trunk/src/java/org/apache/cocoon/environment/http: ContextURLException.java HttpContext.java HttpRequest.java RequestEncodingException.java

Author: bloritsch
Date: Fri Sep 30 06:55:41 2005
New Revision: 292734

URL: http://svn.apache.org/viewcvs?rev=292734&view=rev
Log:
add some more meaningful exceptions here

Added:
    cocoon/trunk/src/java/org/apache/cocoon/environment/http/ContextURLException.java
    cocoon/trunk/src/java/org/apache/cocoon/environment/http/RequestEncodingException.java
Modified:
    cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpContext.java
    cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpRequest.java

Added: cocoon/trunk/src/java/org/apache/cocoon/environment/http/ContextURLException.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/environment/http/ContextURLException.java?rev=292734&view=auto
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/environment/http/ContextURLException.java (added)
+++ cocoon/trunk/src/java/org/apache/cocoon/environment/http/ContextURLException.java Fri Sep 30 06:55:41 2005
@@ -0,0 +1,31 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.environment.http;
+
+import org.apache.avalon.framework.CascadingRuntimeException;
+
+public final class ContextURLException extends CascadingRuntimeException
+{
+    public ContextURLException(String message)
+    {
+        super(message, null);
+    }
+
+    public ContextURLException(String message, Throwable cause)
+    {
+        super(message, cause);
+    }
+}

Modified: cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpContext.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpContext.java?rev=292734&r1=292733&r2=292734&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpContext.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpContext.java Fri Sep 30 06:55:41 2005
@@ -23,7 +23,6 @@
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.cocoon.environment.impl.AbstractContext;
 
 /**
@@ -78,7 +77,7 @@
                 try {
                 value = this.servletContext.getResource("/WEB-INF/web.xml").toString();
                 } catch (MalformedURLException mue) {
-                    throw new CascadingRuntimeException("Cannot determine the base URL for " + path, mue);
+                    throw new ContextURLException("Cannot determine the base URL for " + path, mue);
                 }
                 value = value.substring(0,value.length()-"WEB-INF/web.xml".length());
             }

Modified: cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpRequest.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpRequest.java?rev=292734&r1=292733&r2=292734&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpRequest.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpRequest.java Fri Sep 30 06:55:41 2005
@@ -30,7 +30,6 @@
 import javax.servlet.RequestDispatcher;
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.cocoon.environment.Cookie;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.Session;
@@ -406,7 +405,7 @@
             byte[] bytes = str.getBytes(this.container_encoding);
             return new String(bytes, form_encoding);
         } catch (java.io.UnsupportedEncodingException uee) {
-            throw new CascadingRuntimeException("Unsupported Encoding Exception", uee);
+            throw new RequestEncodingException("Unsupported Encoding Exception", uee);
         }
     }
 

Added: cocoon/trunk/src/java/org/apache/cocoon/environment/http/RequestEncodingException.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/environment/http/RequestEncodingException.java?rev=292734&view=auto
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/environment/http/RequestEncodingException.java (added)
+++ cocoon/trunk/src/java/org/apache/cocoon/environment/http/RequestEncodingException.java Fri Sep 30 06:55:41 2005
@@ -0,0 +1,31 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.environment.http;
+
+import org.apache.avalon.framework.CascadingRuntimeException;
+
+public final class RequestEncodingException extends CascadingRuntimeException
+{
+    public RequestEncodingException(String message)
+    {
+        super(message, null);
+    }
+
+    public RequestEncodingException(String message, Throwable cause)
+    {
+        super(message, cause);
+    }
+}