diff options
author | Mark Spruiell <mes@zeroc.com> | 2011-03-30 10:51:07 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2011-03-30 10:51:07 -0700 |
commit | c28875d4c01935919396999852cb1c3f92c0fdbc (patch) | |
tree | 12f6b1cefe57d572121dcb47bd22b2f65dc3edff /java/src/Freeze/Index.java | |
parent | 4986 - add constructor that takes Throwable (diff) | |
download | ice-c28875d4c01935919396999852cb1c3f92c0fdbc.tar.bz2 ice-c28875d4c01935919396999852cb1c3f92c0fdbc.tar.xz ice-c28875d4c01935919396999852cb1c3f92c0fdbc.zip |
4987 - preserve exception cause
Diffstat (limited to 'java/src/Freeze/Index.java')
-rw-r--r-- | java/src/Freeze/Index.java | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/java/src/Freeze/Index.java b/java/src/Freeze/Index.java index e92c5ce2b02..33ebfd97953 100644 --- a/java/src/Freeze/Index.java +++ b/java/src/Freeze/Index.java @@ -143,10 +143,8 @@ public abstract class Index implements com.sleepycat.db.SecondaryKeyCreator if(tx != null) { - DeadlockException ex = new DeadlockException( - _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), transaction); - ex.initCause(dx); - throw ex; + throw new DeadlockException( _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), + transaction, dx); } // @@ -155,10 +153,7 @@ public abstract class Index implements com.sleepycat.db.SecondaryKeyCreator } catch(com.sleepycat.db.DatabaseException dx) { - DatabaseException ex = new DatabaseException(); - ex.initCause(dx); - ex.message = _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(); - throw ex; + throw new DatabaseException(_store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), dx); } finally { @@ -172,10 +167,8 @@ public abstract class Index implements com.sleepycat.db.SecondaryKeyCreator { if(tx != null) { - DeadlockException ex = new DeadlockException( - _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), transaction); - ex.initCause(dx); - throw ex; + throw new DeadlockException( + _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), transaction, dx); } } catch(com.sleepycat.db.DatabaseException dx) @@ -260,10 +253,8 @@ public abstract class Index implements com.sleepycat.db.SecondaryKeyCreator if(tx != null) { - DeadlockException ex = new DeadlockException( - _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), transaction); - ex.initCause(dx); - throw ex; + throw new DeadlockException( _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), + transaction, dx); } // // Otherwise retry @@ -271,10 +262,7 @@ public abstract class Index implements com.sleepycat.db.SecondaryKeyCreator } catch(com.sleepycat.db.DatabaseException dx) { - DatabaseException ex = new DatabaseException(); - ex.initCause(dx); - ex.message = _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(); - throw ex; + throw new DatabaseException(_store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), dx); } finally { @@ -288,10 +276,8 @@ public abstract class Index implements com.sleepycat.db.SecondaryKeyCreator { if(tx != null) { - DeadlockException ex = new DeadlockException( - _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), transaction); - ex.initCause(dx); - throw ex; + throw new DeadlockException( + _store.evictor().errorPrefix() + "Db.cursor: " + dx.getMessage(), transaction, dx); } } catch(com.sleepycat.db.DatabaseException dx) @@ -375,10 +361,7 @@ public abstract class Index implements com.sleepycat.db.SecondaryKeyCreator } catch(com.sleepycat.db.DatabaseException dx) { - DatabaseException ex = new DatabaseException(); - ex.initCause(dx); - ex.message = _store.evictor().errorPrefix() + "Db.close: " + dx.getMessage(); - throw ex; + throw new DatabaseException(_store.evictor().errorPrefix() + "Db.close: " + dx.getMessage(), dx); } _db = null; } |