Skip to content

Commit 289e339

Browse files
committed
cleanup
1 parent e648e85 commit 289e339

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ func main() {
102102
status, cleanup, err := dockerRun(cfg, hostcfg, sess, *cmd, *exportFolder)
103103
defer cleanup()
104104
if err != nil {
105-
fmt.Fprintln(sess, err)
106-
ErrorPrint(err.Error())
105+
sess.Write([]byte("Error executing container: [" + err.Error() + "]\n"))
106+
ErrorPrint("Failed to execute: %s", err.Error())
107107
}
108108
sess.Exit(int(status))
109109
})
@@ -233,14 +233,14 @@ func dockerRun(
233233
startErr := docker.ContainerStart(ctx, resp.ID, container.StartOptions{})
234234
if startErr != nil {
235235
ErrorPrint("Unable to start container: %s", startErr)
236-
sess.Write([]byte("Unable to pull requested image" + string(startErr.Error()) + "\n"))
236+
sess.Write([]byte("Unable to start requested image: [" + string(startErr.Error()) + "]\n"))
237237
return
238238
}
239239
InfoPrint("Wait for container %s to be ready", resp.ID)
240240
err = waitForContainerReady(ctx, sess, docker, resp.ID, 30*time.Second)
241241
if err != nil {
242-
sess.Write([]byte("container failed to become ready"))
243-
log.Print("Container failed to become ready:", err)
242+
sess.Write([]byte("Container failed to become ready: [" + err.Error() + "]\n"))
243+
log.Print("Container failed to become ready: ", err)
244244
return
245245
}
246246
execResp, err := docker.ContainerExecCreate(ctx, resp.ID, container.ExecOptions{

0 commit comments

Comments
 (0)