Skip to content

Commit 162d821

Browse files
authored
Add the path to the rethrown exception in case the zipfs can't be opened (#71)
1 parent 312eb11 commit 162d821

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/cpw/mods/niofs/union/UnionFileSystem.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ private static class UncheckedIOException extends java.io.UncheckedIOException {
8383
public UncheckedIOException(final IOException cause) {
8484
super(cause);
8585
}
86+
87+
public UncheckedIOException(final String message, final IOException cause) {
88+
super(message, cause);
89+
}
8690

8791
@Override
8892
public synchronized Throwable fillInStackTrace() {
@@ -139,9 +143,9 @@ private static Optional<EmbeddedFileSystemMetadata> openFileSystem(final Path pa
139143
}
140144
return Optional.of(new EmbeddedFileSystemMetadata(path, zfs, fci));
141145
} catch (IOException e) {
142-
throw new UncheckedIOException(e);
146+
throw new UncheckedIOException("Failed to open file system from path " + path, e);
143147
} catch (Throwable t) {
144-
throw new IllegalStateException(t);
148+
throw new IllegalStateException("Failed to open file system from path " + path, t);
145149
}
146150
}
147151

0 commit comments

Comments
 (0)