aboutsummaryrefslogtreecommitdiffstats
path: root/yolean
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@oath.com>2018-11-25 21:55:07 +0100
committerHåkon Hallingstad <hakon@oath.com>2018-11-25 21:55:07 +0100
commit1e3df1dcc8456c6f1df160eb346afd2385eaa00b (patch)
tree1122e6085805b94d8b8a5160158a28d879a5deac /yolean
parent660d28ed2ac5cd98acef4fae8e7b22a92cbdbc13 (diff)
remove references to IOExceptionUtil
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);
}