Pārlūkot izejas kodu

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>
Sebastiaan van Stijn 1 gadu atpakaļ
vecāks
revīzija
642cf261a8
1 mainītis faili ar 1 papildinājumiem un 7 dzēšanām
  1. 1 7
      libnetwork/controller.go

+ 1 - 7
libnetwork/controller.go

@@ -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.