summaryrefslogtreecommitdiffstats
path: root/yolean
diff options
context:
space:
mode:
Diffstat (limited to 'yolean')
-rw-r--r--yolean/src/main/java/com/yahoo/yolean/Exceptions.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/yolean/src/main/java/com/yahoo/yolean/Exceptions.java b/yolean/src/main/java/com/yahoo/yolean/Exceptions.java
index bbd03bbdc9e..4144af81a61 100644
--- a/yolean/src/main/java/com/yahoo/yolean/Exceptions.java
+++ b/yolean/src/main/java/com/yahoo/yolean/Exceptions.java
@@ -79,6 +79,11 @@ public class Exceptions {
runnable.run();
} catch (NoSuchFileException e) {
// Do nothing - OK
+ } catch (UncheckedIOException e) {
+ if (! (e.getCause() instanceof NoSuchFileException)) {
+ throw e;
+ }
+ // Do nothing - OK
} catch (IOException e) {
throw new UncheckedIOException(e);
}
@@ -118,6 +123,11 @@ public class Exceptions {
return Optional.ofNullable(supplier.get());
} catch (NoSuchFileException e) {
return Optional.empty();
+ } catch (UncheckedIOException e) {
+ if (e.getCause() instanceof NoSuchFileException) {
+ return Optional.empty();
+ }
+ throw e;
} catch (IOException e) {
throw new UncheckedIOException(e);
}