From daa18ff0294141ef616f6387bda6a90dce3d1695 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Wed, 1 May 2024 19:09:24 +0300 Subject: [PATCH] Add the path to the rethrown exception in case the zipfs can't be opened --- src/main/java/cpw/mods/niofs/union/UnionFileSystem.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java b/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java index 4264978..a89da3e 100644 --- a/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java +++ b/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java @@ -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() { @@ -139,9 +143,9 @@ private static Optional 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); } }