Skip to content

Commit

Permalink
container wait: improve error message
Browse files Browse the repository at this point in the history
Improve the error message when looking up the exit code of a container.
The state of the container may help us track down containers#14859 which flakes
rarely and is impossible to reproduce on my machine.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
  • Loading branch information
vrothberg committed Jul 22, 2022
1 parent 02eb057 commit 16ffd41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/container_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ func (c *Container) WaitForExit(ctx context.Context, pollInterval time.Duration)
// The container never ran.
return true, 0, nil
}
return true, -1, err
return true, -1, fmt.Errorf("%v (container in state %s)", err, c.state.State)
}

return true, exitCode, nil
Expand Down

0 comments on commit 16ffd41

Please sign in to comment.