From 46a14e1941186b99ff61df9c12081adf57ca9e63 Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 16 Jun 2006 17:18:51 +0000 Subject: [PATCH] * Use logError() instead of logEvent() to log exceptions. * Use Exception constructor that takes original exception as second argument to propagate errors. This is safe since we now require Java 1.4 anyways. --- .../objectmodel/db/WrappedNodeManager.java | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/src/helma/objectmodel/db/WrappedNodeManager.java b/src/helma/objectmodel/db/WrappedNodeManager.java index e038f5b6..40c60349 100644 --- a/src/helma/objectmodel/db/WrappedNodeManager.java +++ b/src/helma/objectmodel/db/WrappedNodeManager.java @@ -61,13 +61,11 @@ public final class WrappedNodeManager { } catch (ObjectNotFoundException x) { return null; } catch (Exception x) { - nmgr.app.logEvent("Error retrieving Node for "+key+": " + x); - + nmgr.app.logError("Error retrieving Node for " + key, x); if (nmgr.app.debug()) { x.printStackTrace(); } - - throw new RuntimeException("Error retrieving Node: " + x); + throw new RuntimeException("Error retrieving Node", x); } } @@ -85,14 +83,11 @@ public final class WrappedNodeManager { } catch (ObjectNotFoundException x) { return null; } catch (Exception x) { - nmgr.app.logEvent("Error retrieving Node \"" + id + "\" from " + home + ": " + - x); - + nmgr.app.logError("Error retrieving Node \"" + id + "\" from " + home, x); if (nmgr.app.debug()) { x.printStackTrace(); } - - throw new RuntimeException("Error retrieving Node: " + x); + throw new RuntimeException("Error retrieving Node", x); } } @@ -111,8 +106,7 @@ public final class WrappedNodeManager { if (nmgr.app.debug()) { x.printStackTrace(); } - - throw new RuntimeException("Error retrieving Nodes: " + x); + throw new RuntimeException("Error retrieving Nodes", x); } } @@ -131,8 +125,7 @@ public final class WrappedNodeManager { if (nmgr.app.debug()) { x.printStackTrace(); } - - throw new RuntimeException("Error retrieving NodeIDs: " + x); + throw new RuntimeException("Error retrieving NodeIDs", x); } } @@ -146,8 +139,7 @@ public final class WrappedNodeManager { if (nmgr.app.debug()) { x.printStackTrace(); } - - throw new RuntimeException("Error retrieving NodeIDs: ", x); + throw new RuntimeException("Error retrieving NodeIDs", x); } } @@ -166,8 +158,7 @@ public final class WrappedNodeManager { if (nmgr.app.debug()) { x.printStackTrace(); } - - throw new RuntimeException("Error counting Node: " + x); + throw new RuntimeException("Error counting Nodes", x); } } @@ -183,8 +174,7 @@ public final class WrappedNodeManager { if (nmgr.app.debug()) { x.printStackTrace(); } - - throw new RuntimeException("Error deleting Node: " + x); + throw new RuntimeException("Error deleting Node", x); } } @@ -203,8 +193,7 @@ public final class WrappedNodeManager { if (nmgr.app.debug()) { x.printStackTrace(); } - - throw new RuntimeException("Error retrieving property names: " + x); + throw new RuntimeException("Error retrieving property names ", x); } }