diff --git a/daemon/container_operations.go b/daemon/container_operations.go index 7a1b5c4005..ccdbb384ad 100644 --- a/daemon/container_operations.go +++ b/daemon/container_operations.go @@ -992,8 +992,7 @@ func (daemon *Daemon) getNetworkedContainer(containerID, connectedContainerID st return nil, fmt.Errorf("cannot join own network") } if !nc.IsRunning() { - err := fmt.Errorf("cannot join network of a non running container: %s", connectedContainerID) - return nil, errdefs.Conflict(err) + return nil, errdefs.Conflict(fmt.Errorf("cannot join network of a non running container: %s", connectedContainerID)) } if nc.IsRestarting() { return nil, errContainerIsRestarting(connectedContainerID)