Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Dec 10, 2024
1 parent fdc699a commit 4afbd81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public WrapperFormattingStep(String name, String workflowName, Project project,
}
return null;
}).flatMap(javaToolchainService::launcherFor).orElse(javaToolchainService.launcherFor(spec -> {})));
getJavaLauncher().convention(javaToolchainService.launcherFor(spec -> {}));
this.objectFactory = objectFactory;
getHideStacktrace().convention(project.getGradle().getStartParameter().getShowStacktrace() == ShowStacktrace.INTERNAL_EXCEPTIONS);
this.getDependencies().getRuntime().add("dev.lukebemish.immaculate:wrapper", dep -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ public String format(String fileName, String text) {
try {
int ok = formatter.format(fullArgs);
if (ok != 0) {
throw new RuntimeException("Failed to format " + fileName);
throw new RuntimeException("Failed to format " + fileName + ", exit code: " + ok);
}
} catch (Exception e) {
if (e instanceof RuntimeException runtimeException) {
throw runtimeException;
} else {
throw new RuntimeException(e);
}
} finally {
errWriter.flush();
outWriter.flush();
}
errWriter.flush();
outWriter.flush();
return outputStream.toString(StandardCharsets.UTF_8);
}
}

0 comments on commit 4afbd81

Please sign in to comment.