From: kkolinko Date: Mon, 25 Oct 2010 00:13:56 +0000 (+0000) Subject: Improve exception handling in PersistentManagerBase. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cfc71f920a0fcbcf667b02b3ea909e705b05fb5a;p=tomcat7.0 Improve exception handling in PersistentManagerBase. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1026920 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/session/PersistentManagerBase.java b/java/org/apache/catalina/session/PersistentManagerBase.java index afa70c52c..b288bc204 100644 --- a/java/org/apache/catalina/session/PersistentManagerBase.java +++ b/java/org/apache/catalina/session/PersistentManagerBase.java @@ -412,15 +412,14 @@ public abstract class PersistentManagerBase extends ManagerBase { 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 PersistentManagerBase extends ManagerBase { }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 PersistentManagerBase extends ManagerBase { 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);