← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2181: Added tomcat-specific hack to get rid of useless stack traces when the client aborts.

 

------------------------------------------------------------
revno: 2181
committer: Jo Størset <storset@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2010-11-26 16:22:50 +0530
message:
  Added tomcat-specific hack to get rid of useless stack traces when the client aborts.
  (If anyone has a better way, please tell)
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ExceptionInterceptor.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ExceptionInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ExceptionInterceptor.java	2010-05-26 14:45:10 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ExceptionInterceptor.java	2010-11-26 10:52:50 +0000
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -116,6 +117,12 @@
                 return EXCEPTION_RESULT_ACCESS_DENIED; // Access denied as nice page
             }
 
+            // HACK to get rid of useless stack traces when the client closes the connection in tomcat
+            if (e instanceof IOException && e.getClass().getName().equals("org.apache.catalina.connector.ClientAbortException") )
+            {
+                LOG.info( "Client aborted connection." );
+            }
+            
             LOG.error( "Error while executing action", e );
 
             if ( exceptionResultName != null )