roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r372703 - in /incubator/roller/trunk/src/org/roller/presentation/velocity: FlavorServlet.java PageServlet.java
Date Fri, 27 Jan 2006 02:26:52 GMT
Author: agilliland
Date: Thu Jan 26 18:26:48 2006
New Revision: 372703

URL: http://svn.apache.org/viewcvs?rev=372703&view=rev
Log:
it appears that exceptions caught by the VelocityServlet error() method are always some form
of SocketException, so they should be safe to ignore.

however, we do want to set the "DisplayException" request attribute so that our cache filters
know not to cache the broken response.


Modified:
    incubator/roller/trunk/src/org/roller/presentation/velocity/FlavorServlet.java
    incubator/roller/trunk/src/org/roller/presentation/velocity/PageServlet.java

Modified: incubator/roller/trunk/src/org/roller/presentation/velocity/FlavorServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/velocity/FlavorServlet.java?rev=372703&r1=372702&r2=372703&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/velocity/FlavorServlet.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/velocity/FlavorServlet.java Thu Jan
26 18:26:48 2006
@@ -154,7 +154,13 @@
      */
     protected void error( HttpServletRequest req, HttpServletResponse res,
             Exception e) throws ServletException, IOException {
-        mLogger.warn("ERROR in FlavorServlet",e);
+        
+        // this means there was an exception outside of the handleRequest()
+        // method which seems to always be some variant of SocketException
+        // so we just ignore it
+        
+        // make sure anyone downstream knows about the exception
+        req.setAttribute("DisplayException", e);
     }
 }
 

Modified: incubator/roller/trunk/src/org/roller/presentation/velocity/PageServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/velocity/PageServlet.java?rev=372703&r1=372702&r2=372703&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/velocity/PageServlet.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/velocity/PageServlet.java Thu Jan 26
18:26:48 2006
@@ -245,13 +245,14 @@
     protected void error( HttpServletRequest req, HttpServletResponse res,
             Exception e) throws ServletException, IOException {
         
-        if(e instanceof SocketException) {
-            // ignore socket exceptions
-            mLogger.debug("Some kind of SocketException", e);
-        } else {
-            mLogger.warn("ERROR in VelocityServlet " + e.getClass().getName());
-        }
+        // this means there was an exception outside of the handleRequest()
+        // method which seems to always be some variant of SocketException
+        // so we just ignore it
+        
+        // make sure anyone downstream knows about the exception
+        req.setAttribute("DisplayException", e);
     }
+    
     
     /**
      * Override to prevent Velocity from putting "req" and "res" into the context.



Mime
View raw message