roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r379201 - /incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java
Date Mon, 20 Feb 2006 19:04:50 GMT
Author: agilliland
Date: Mon Feb 20 11:04:48 2006
New Revision: 379201

URL: http://svn.apache.org/viewcvs?rev=379201&view=rev
Log:
tidying up exception handling.  we don't need to flood the logs with messages when we request
is a 404.


Modified:
    incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java

Modified: incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java?rev=379201&r1=379200&r2=379201&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/filters/RefererFilter.java Mon Feb
20 11:04:48 2006
@@ -12,7 +12,6 @@
 import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.roller.RollerException;
 import org.roller.business.referrers.IncomingReferrer;
 import org.roller.business.referrers.ReferrerQueueManager;
 import org.roller.model.RollerFactory;
@@ -20,6 +19,7 @@
 import org.roller.config.RollerConfig;
 import org.roller.model.UserManager;
 import org.roller.pojos.WebsiteData;
+import org.roller.presentation.InvalidRequestException;
 import org.roller.presentation.WeblogPageRequest;
 import org.roller.util.SpamChecker;
 
@@ -66,19 +66,16 @@
         WeblogPageRequest pageRequest = null;
         try {
             pageRequest = new WeblogPageRequest(request);
-            String handle = pageRequest.getWeblogHandle();
             UserManager userMgr = RollerFactory.getRoller().getUserManager();
-            weblog = userMgr.getWebsiteByHandle(handle);
-      
-        } catch(Exception e) {
-            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-            mLogger.warn("ERROR processing request: "+request.getRequestURL());
-            return;
-        }
-        
-        // ReferrerManager only cares about weblog referrers
-        if (weblog == null) {             
-            chain.doFilter(req, res);
+            weblog = userMgr.getWebsiteByHandle(pageRequest.getWeblogHandle());
+            
+            if(weblog == null) {
+                throw new Exception("no weblog named "+pageRequest.getWeblogHandle());
+            }
+            
+        } catch(Exception ex) {
+            // bad url or couldn't obtain weblog
+            response.sendError(HttpServletResponse.SC_NOT_FOUND);
             return;
         }
         



Mime
View raw message