You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2010/10/25 02:13:56 UTC

svn commit: r1026920 - /tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java

Author: kkolinko
Date: Mon Oct 25 00:13:56 2010
New Revision: 1026920

URL: http://svn.apache.org/viewvc?rev=1026920&view=rev
Log:
Improve exception handling in PersistentManagerBase.

Modified:
    tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java

Modified: tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java?rev=1026920&r1=1026919&r2=1026920&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java Mon Oct 25 00:13:56 2010
@@ -412,15 +412,14 @@ public abstract class PersistentManagerB
                     AccessController.doPrivileged(new PrivilegedStoreClear());
                 }catch(PrivilegedActionException ex){
                     Exception exception = ex.getException();
-                    log.error("Exception clearing the Store: " + exception);
-                    exception.printStackTrace();                        
+                    log.error("Exception clearing the Store: " + exception,
+                            exception);
                 }
             } else {
                 store.clear();
             }
         } catch (IOException e) {
-            log.error("Exception clearing the Store: " + e);
-            e.printStackTrace();
+            log.error("Exception clearing the Store: " + e, e);
         }
 
     }
@@ -609,15 +608,13 @@ public abstract class PersistentManagerB
                 }catch(PrivilegedActionException ex){
                     Exception exception = ex.getException();
                     log.error("Exception in the Store during removeSession: "
-                              + exception);
-                    exception.printStackTrace();                        
+                              + exception, exception);
                 }
             } else {
                  store.remove(id);
             }               
         } catch (IOException e) {
-            log.error("Exception removing session  " + e.getMessage());
-            e.printStackTrace();
+            log.error("Exception removing session  " + e.getMessage(), e);
         }        
     }
 
@@ -797,9 +794,11 @@ public abstract class PersistentManagerB
                     AccessController.doPrivileged(new PrivilegedStoreSave(session));
                 }catch(PrivilegedActionException ex){
                     Exception exception = ex.getException();
+                    if (exception instanceof IOException) {
+                        throw (IOException) exception;
+                    }
                     log.error("Exception in the Store during writeSession: "
-                              + exception);
-                    exception.printStackTrace();                        
+                              + exception, exception);
                 }
             } else {
                  store.save(session);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org