Skip to content

Commit

Permalink
Add the path to the rethrown exception in case the zipfs can't be ope…
Browse files Browse the repository at this point in the history
…ned (#71)
  • Loading branch information
Matyrobbrt authored May 1, 2024
1 parent 312eb11 commit 162d821
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/cpw/mods/niofs/union/UnionFileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ private static class UncheckedIOException extends java.io.UncheckedIOException {
public UncheckedIOException(final IOException cause) {
super(cause);
}

public UncheckedIOException(final String message, final IOException cause) {
super(message, cause);
}

@Override
public synchronized Throwable fillInStackTrace() {
Expand Down Expand Up @@ -139,9 +143,9 @@ private static Optional<EmbeddedFileSystemMetadata> openFileSystem(final Path pa
}
return Optional.of(new EmbeddedFileSystemMetadata(path, zfs, fci));
} catch (IOException e) {
throw new UncheckedIOException(e);
throw new UncheckedIOException("Failed to open file system from path " + path, e);
} catch (Throwable t) {
throw new IllegalStateException(t);
throw new IllegalStateException("Failed to open file system from path " + path, t);
}
}

Expand Down

0 comments on commit 162d821

Please sign in to comment.