Print/rethrow full exception string when an exception is caught from

NodeWrapper, since the exception message without the exception class is often
not very telling (e.g. "128" in ArrayIndexOutOfBoundsExceptions).
This commit is contained in:
hns 2002-10-16 13:25:36 +00:00
parent e91d06e88e
commit 558c5a5660

View file

@ -32,10 +32,10 @@ import java.util.Vector;
} catch (ObjectNotFoundException x) { } catch (ObjectNotFoundException x) {
return null; return null;
} catch (Exception x) { } catch (Exception x) {
nmgr.app.logEvent ("Error retrieving Node via DbMapping: "+x.getMessage ()); nmgr.app.logEvent ("Error retrieving Node via DbMapping: "+x);
if (nmgr.app.debug ()) if (nmgr.app.debug ())
x.printStackTrace(); x.printStackTrace();
throw new RuntimeException ("Error retrieving Node: "+x.getMessage ()); throw new RuntimeException ("Error retrieving Node: "+x);
} }
} }
@ -45,10 +45,10 @@ import java.util.Vector;
} catch (ObjectNotFoundException x) { } catch (ObjectNotFoundException x) {
return null; return null;
} catch (Exception x) { } catch (Exception x) {
nmgr.app.logEvent ("Error retrieving Node \""+id+"\" from "+home+": "+x.getMessage ()); nmgr.app.logEvent ("Error retrieving Node \""+id+"\" from "+home+": "+x);
if (nmgr.app.debug ()) if (nmgr.app.debug ())
x.printStackTrace(); x.printStackTrace();
throw new RuntimeException ("Error retrieving Node: "+x.getMessage ()); throw new RuntimeException ("Error retrieving Node: "+x);
} }
} }
@ -58,7 +58,7 @@ import java.util.Vector;
} catch (Exception x) { } catch (Exception x) {
if (nmgr.app.debug ()) if (nmgr.app.debug ())
x.printStackTrace(); x.printStackTrace();
throw new RuntimeException ("Error retrieving Nodes: "+x.getMessage ()); throw new RuntimeException ("Error retrieving Nodes: "+x);
} }
} }
@ -68,7 +68,7 @@ import java.util.Vector;
} catch (Exception x) { } catch (Exception x) {
if (nmgr.app.debug ()) if (nmgr.app.debug ())
x.printStackTrace(); x.printStackTrace();
throw new RuntimeException ("Error retrieving NodeIDs: "+x.getMessage ()); throw new RuntimeException ("Error retrieving NodeIDs: "+x);
} }
} }
@ -78,7 +78,7 @@ import java.util.Vector;
} catch (Exception x) { } catch (Exception x) {
if (nmgr.app.debug ()) if (nmgr.app.debug ())
x.printStackTrace(); x.printStackTrace();
throw new RuntimeException ("Error counting Node: "+x.getMessage ()); throw new RuntimeException ("Error counting Node: "+x);
} }
} }
@ -88,7 +88,7 @@ import java.util.Vector;
} catch (Exception x) { } catch (Exception x) {
if (nmgr.app.debug ()) if (nmgr.app.debug ())
x.printStackTrace(); x.printStackTrace();
throw new RuntimeException ("Error deleting Node: "+x.getMessage ()); throw new RuntimeException ("Error deleting Node: "+x);
} }
} }
@ -98,7 +98,7 @@ import java.util.Vector;
} catch (Exception x) { } catch (Exception x) {
if (nmgr.app.debug ()) if (nmgr.app.debug ())
x.printStackTrace(); x.printStackTrace();
throw new RuntimeException ("Error retrieving property names: "+x.getMessage ()); throw new RuntimeException ("Error retrieving property names: "+x);
} }
} }