1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #18451 from WeiZhang555/net-err

Better error message for network connect
This commit is contained in:
Phil Estes 2015-12-07 09:17:48 -05:00
commit 7d6a2e3cf5

View file

@ -616,7 +616,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
ep, err := container.GetEndpointInNetwork(n)
if err == nil {
return fmt.Errorf("container already connected to network %s", idOrName)
return fmt.Errorf("Conflict. A container with name %q is already connected to network %s.", strings.TrimPrefix(container.Name, "/"), idOrName)
}
if _, ok := err.(libnetwork.ErrNoSuchEndpoint); !ok {