This commit is contained in:
Brian Neumann-Fopiano committed 2026-10-31 22:42:16 -04:00
1 parent 2d4ede41dd
commit 8734c38361
2 files changed
+36 -8

No files matched your search

@@ -49,19 +49,24 @@ public abstract class IrisModdedBuildAction implements WorkAction<IrisModdedBuil
LOGGER.lifecycle("{} succeeded in {} ms", label,
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - started));
} catch (Exception failure) {
appendFailure(log, failure);
String details;
try {
details = logTail(log);
} catch (IOException unreadable) {
failure.addSuppressed(unreadable);
details = "Log could not be read.";
}
String details = failureSummary(log, failure);
LOGGER.error(label + " failed; log: " + log + System.lineSeparator() + details, failure);
throw new GradleException(label + " failed; log: " + log, failure);
}
}
static String failureSummary(Path log, Exception failure) {
String details;
try {
details = logTail(log);
} catch (IOException unreadable) {
failure.addSuppressed(unreadable);
details = "Log could not be read.";
}
appendFailure(log, failure);
return details;
}
static String logTail(Path log) throws IOException {
try (RandomAccessFile input = new RandomAccessFile(log.toFile(), "r")) {
long offset = Math.max(0L, input.length() - LOG_TAIL_BYTES);