[FILEUPLOAD-242] Do not silently swallow all Throwables.
Instead swallow only Exceptions
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/fileupload/trunk@1643019 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/commons/fileupload/FileUploadBase.java b/src/main/java/org/apache/commons/fileupload/FileUploadBase.java
index 88ce82c..1795b3d 100644
--- a/src/main/java/org/apache/commons/fileupload/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload/FileUploadBase.java
@@ -366,8 +366,8 @@
for (FileItem fileItem : items) {
try {
fileItem.delete();
- } catch (Throwable t) {
- handleThrowable(t);
+ } catch (Exception ignored) {
+ // ignored TODO perhaps add to tracker delete failure list somehow?
}
}
}
@@ -375,25 +375,6 @@
}
/**
- * Checks whether the supplied Throwable is one that needs to be
- * rethrown and swallows all others.
- * @param t the Throwable to check
- */
- private void handleThrowable(Throwable t) {
- if (t instanceof ThreadDeath) {
- throw (ThreadDeath) t;
- }
- if (t instanceof StackOverflowError) {
- // Swallow silently - it should be recoverable
- return;
- }
- if (t instanceof VirtualMachineError) {
- throw (VirtualMachineError) t;
- }
- // All other instances of Throwable will be silently swallowed
- }
-
- /**
* Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant <code>multipart/form-data</code> stream.
*