Skip to content

Commit da8e318

Browse files
author
Niall Pemberton
committed
IO-135 - change deleteQuietly() to catch Exception rather than Throwable as per Stephen's comment on dev@:
"I think I would prefer catch(Exception) rather than catch(Throwable).Hiding an OutOfMemoryError (and similar) is generally a Bad Idea." git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@609395 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8e9a08a commit da8e318

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/java/org/apache/commons/io/FileUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,12 +915,12 @@ public static boolean deleteQuietly(File file) {
915915
if (file.isDirectory()) {
916916
cleanDirectory(file);
917917
}
918-
} catch (Throwable t) {
918+
} catch (Exception e) {
919919
}
920920

921921
try {
922922
return file.delete();
923-
} catch (Throwable t) {
923+
} catch (Exception e) {
924924
return false;
925925
}
926926
}

0 commit comments

Comments
 (0)