Also add suppressed exception if unchecked exception occurs in finally
If a method called in a finally block throws an exception we should add exceptions caught earlier to the exception we throw in the finally block not regarding if it's a checked or unchecked exception. Change-Id: I4c6be9a3a08482b07659ca31d6987ce719d81ca5
This commit is contained in:
parent
4562e79e23
commit
2cbf0c1774
|
@ -1723,6 +1723,11 @@ private void parallelDeltaSearch(ProgressMonitor monitor,
|
||||||
}
|
}
|
||||||
throw new IOException(JGitText
|
throw new IOException(JGitText
|
||||||
.get().packingCancelledDuringObjectsWriting, e);
|
.get().packingCancelledDuringObjectsWriting, e);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
if (e1 != null) {
|
||||||
|
e.addSuppressed(e1);
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ void execute(ProgressMonitor monitor, FetchResult result,
|
||||||
for (PackLock lock : packLocks) {
|
for (PackLock lock : packLocks) {
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (Throwable e) {
|
||||||
if (e1 != null) {
|
if (e1 != null) {
|
||||||
e.addSuppressed(e1);
|
e.addSuppressed(e1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,9 +530,10 @@ private boolean downloadPackedObject(final ProgressMonitor monitor,
|
||||||
// are unusable and we shouldn't consult them again.
|
// are unusable and we shouldn't consult them again.
|
||||||
//
|
//
|
||||||
try {
|
try {
|
||||||
if (pack.tmpIdx != null)
|
if (pack.tmpIdx != null) {
|
||||||
FileUtils.delete(pack.tmpIdx);
|
FileUtils.delete(pack.tmpIdx);
|
||||||
} catch (IOException e) {
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
if (e1 != null) {
|
if (e1 != null) {
|
||||||
e.addSuppressed(e1);
|
e.addSuppressed(e1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue