Author: jdonnerstag
Date: Fri Aug 31 23:48:09 2007
New Revision: 571721

URL: http://svn.apache.org/viewvc?rev=571721&view=rev
Log:
wicket 908: There is no way to specify what exceptions to log in RequestCycle

provided onRuntimeException for users to replace/enhance

Modified:
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java?rev=571721&r1=571720&r2=571721&view=diff
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java 
(original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java 
Fri Aug 31 23:48:09 2007
@@ -1118,10 +1118,7 @@
                                // probably our last chance the exception can 
be logged.
                                // Note that a PageExpiredException should not 
be logged, because
                                // it's not an internal error
-                               if (!(e instanceof PageExpiredException))
-                               {
-                                       logRuntimeException(e);
-                               }
+                               onRuntimeException(e);
 
                                // try to play nicely and let the request 
processor handle the
                                // exception response. If that doesn't work, 
any runtime exception
@@ -1138,6 +1135,22 @@
                                                "unexpected exception when 
handling another exception: " + e.getMessage(),
                                                e);
                        }
+               }
+       }
+
+       /**
+        * Called when an unrecoverable runtime exception during request cycle 
handling occured, which
+        * will result in displaying a user facing error page. Clients can 
override this method in case
+        * they want to customize logging.
+        * 
+        * @param e
+        *            the runtime exception
+        */
+       protected void onRuntimeException(RuntimeException e)
+       {
+               if (!(e instanceof PageExpiredException))
+               {
+                       logRuntimeException(e);
                }
        }
 

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java?rev=571721&r1=571720&r2=571721&view=diff
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java
 Fri Aug 31 23:48:09 2007
@@ -212,10 +212,7 @@
                                        throw ex;
                                }
 
-                               if (!(ex instanceof PageExpiredException))
-                               {
-                                       logRuntimeException(ex);
-                               }
+                               onRuntimeException(ex);
 
                                IRequestCycleProcessor processor = 
getProcessor();
                                processor.respond(ex, this);


Reply via email to