Browse Source

Fix daemon.getExecConfig(): not using typed errNotRunning() error

This makes daemon.getExecConfig return a errdefs.Conflict() error if the
container is not running.

This was originally the case, but a refactor of this code changed the typed
error (`derr.ErrorCodeContainerNotRunning`) to a non-typed error;
a793564b2591035aec5412fbcbcccf220c773a4c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 4 years ago
parent
commit
6eb5720233
1 changed files with 1 additions and 1 deletions
  1. 1 1
      daemon/exec.go

+ 1 - 1
daemon/exec.go

@@ -59,7 +59,7 @@ func (daemon *Daemon) getExecConfig(name string) (*exec.Config, error) {
 		return nil, containerNotFound(name)
 	}
 	if !ctr.IsRunning() {
-		return nil, fmt.Errorf("Container %s is not running: %s", ctr.ID, ctr.State.String())
+		return nil, errNotRunning(ctr.ID)
 	}
 	if ctr.IsPaused() {
 		return nil, errExecPaused(ctr.ID)