diff --git a/libnetwork/network.go b/libnetwork/network.go index 1f79577395..a7a6d0748b 100644 --- a/libnetwork/network.go +++ b/libnetwork/network.go @@ -1181,7 +1181,8 @@ func (n *network) createEndpoint(name string, options ...EndpointOption) (Endpoi ep.locator = n.getController().clusterHostID() ep.network, err = ep.getNetworkFromStore() if err != nil { - return nil, fmt.Errorf("failed to get network during CreateEndpoint: %v", err) + logrus.Errorf("failed to get network during CreateEndpoint: %v", err) + return nil, err } n = ep.network diff --git a/libnetwork/store.go b/libnetwork/store.go index 84507c5b4e..1b850104e9 100644 --- a/libnetwork/store.go +++ b/libnetwork/store.go @@ -85,7 +85,7 @@ func (c *controller) getNetworkFromStore(nid string) (*network, error) { return n, nil } } - return nil, fmt.Errorf("network %s not found", nid) + return nil, ErrNoSuchNetwork(nid) } func (c *controller) getNetworksForScope(scope string) ([]*network, error) {