diff --git a/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java b/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java index 44c20751b..842eeee4b 100644 --- a/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java +++ b/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java @@ -201,6 +201,9 @@ public void run() throws IOException { if (!getUseCache().get()) { try (var timer = new Timer("Decompiled sources")) { runWithoutCache(); + } catch (Exception e) { + ExceptionUtil.printFileLocks(e, getProject()); + throw ExceptionUtil.createDescriptiveWrapper(RuntimeException::new, "Failed to decompile", e); } return; @@ -218,6 +221,9 @@ public void run() throws IOException { try (FileSystemUtil.Delegate fs = FileSystemUtil.getJarFileSystem(cacheFile, true)) { runWithCache(fs.getRoot()); } + } catch (Exception e) { + ExceptionUtil.printFileLocks(e, getProject()); + throw ExceptionUtil.createDescriptiveWrapper(RuntimeException::new, "Failed to decompile", e); } } @@ -415,7 +421,6 @@ private MinecraftJar rebuildInputJar() { final var provideContext = new AbstractMappedMinecraftProvider.ProvideContext(false, true, configContext); minecraftJars = getExtension().getNamedMinecraftProvider().provide(provideContext); } catch (Exception e) { - ExceptionUtil.printFileLocks(e, getProject()); throw ExceptionUtil.createDescriptiveWrapper(RuntimeException::new, "Failed to rebuild input jars", e); }