Skip to content

Commit 296b4b9

Browse files
authored
Merge pull request jenkinsci#50 from mbriand/mbria/show_launcher_error
Show launcher output on remote agent exec failure
2 parents 9d5234b + a61967f commit 296b4b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/cloudbees/jenkins/plugins/sshagent/exec/ExecRemoteAgent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public class ExecRemoteAgent implements RemoteAgent {
6363
ByteArrayOutputStream baos = new ByteArrayOutputStream();
6464
if (launcherProvider.getLauncher().launch().cmds("ssh-agent").stdout(baos).start()
6565
.joinWithTimeout(1, TimeUnit.MINUTES, listener) != 0) {
66-
throw new AbortException("Failed to run ssh-agent");
66+
String reason = new String(baos.toByteArray(), StandardCharsets.US_ASCII);
67+
throw new AbortException("Failed to run ssh-agent: " + reason);
6768
}
6869
agentEnv = parseAgentEnv(new String(baos.toByteArray(), StandardCharsets.US_ASCII), listener); // TODO could include local filenames, better to look up remote charset
6970

0 commit comments

Comments
 (0)