mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
return immediately on error
Signed-off-by: Espen Suenson <mail@espensuenson.dk>
This commit is contained in:
parent
43a3151db2
commit
a1ab732711
1 changed files with 4 additions and 1 deletions
|
@ -81,9 +81,12 @@ func (c *controller) getStores() []datastore.DataStore {
|
|||
|
||||
func (c *controller) getNetworkFromStore(nid string) (*network, error) {
|
||||
ns, err := c.getNetworksFromStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, n := range ns {
|
||||
if n.id == nid {
|
||||
return n, err
|
||||
return n, nil
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("network %s not found", nid)
|
||||
|
|
Loading…
Reference in a new issue