libnetwork: Controller.NetworkByID: remove redundant error-handling
Controller.getNetworkFromStore() already returns a ErrNoSuchNetwork if no network was found, so we don't need to convert the existing error. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
e3975fba84
commit
642cf261a8
1 changed files with 1 additions and 7 deletions
|
@ -863,13 +863,7 @@ func (c *Controller) NetworkByID(id string) (*Network, error) {
|
|||
if id == "" {
|
||||
return nil, ErrInvalidID(id)
|
||||
}
|
||||
|
||||
n, err := c.getNetworkFromStore(id)
|
||||
if err != nil {
|
||||
return nil, ErrNoSuchNetwork(id)
|
||||
}
|
||||
|
||||
return n, nil
|
||||
return c.getNetworkFromStore(id)
|
||||
}
|
||||
|
||||
// NewSandbox creates a new sandbox for containerID.
|
||||
|
|
Loading…
Reference in a new issue