LargeObjectException: Add constructor that takes Throwable

Change-Id: I500959286075f8ba4d0aa5820febd28c9c94ea1b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2017-12-19 14:08:38 +09:00
parent 06bab95e00
commit c228f201a6
2 changed files with 12 additions and 3 deletions

View File

@ -64,6 +64,17 @@ public LargeObjectException() {
// Do nothing.
}
/**
* Create a large object exception, where the object isn't known.
*
* @param cause
* the cause
* @since 4.10
*/
public LargeObjectException(Throwable cause) {
initCause(cause);
}
/**
* Create a large object exception, naming the object that is too big.
*

View File

@ -101,9 +101,7 @@ public byte[] getCachedBytes() throws LargeObjectException {
try {
throw new LargeObjectException(getObjectId());
} catch (IOException cannotObtainId) {
LargeObjectException err = new LargeObjectException();
err.initCause(cannotObtainId);
throw err;
throw new LargeObjectException(cannotObtainId);
}
}