Skip to content

Commit

Permalink
[FIXED JENKINS-27710]: close the output also if file modification was…
Browse files Browse the repository at this point in the history
… interrupted. We also output some warning to the job console, to help troubleshooting a bit and propose a work-around
  • Loading branch information
lacostej committed Apr 2, 2015
1 parent 9ad4d89 commit c177a7f
Showing 1 changed file with 22 additions and 2 deletions.
Expand Up @@ -75,13 +75,33 @@ public Long call() throws IOException {
} catch (IOException ignore) {
}
}
if (closeOut)
out.close();
closeOutIfNecessary();
}
} else {
writeMessagesToOutput("\nWARNING: No change detected to Editor.log path: '" + path + "'.",
"\tThe unity3d plugin was probably unable to find it in its expected locations (see JENKINS-24265).",
"\tConsider using the -logFile argument to force a known editor.log path or report the issue.");
closeOutIfNecessary();
}
return pos;
}

private void closeOutIfNecessary() throws IOException {
if (closeOut)
out.close();
}

private void writeMessagesToOutput(String... msgs) {
PrintStream printStream = new PrintStream(out);
try {
for (String msg : msgs) {
printStream.println(msg);
}
} finally {
printStream.close();
}
}

private void forcePrintStacktrace(Throwable t) {
PrintStream printStream = new PrintStream(out);
try {
Expand Down

0 comments on commit c177a7f

Please sign in to comment.