Files
moby/daemon/libnetwork/drivers/bridge/errors.go
Derek McGowan 7a720df61f Move libnetwork to daemon/libnetwork
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-14 09:25:23 -07:00

47 lines
1.3 KiB
Go

//go:build linux
package bridge
import (
"errors"
"fmt"
"github.com/docker/docker/errdefs"
)
// errInvalidGateway is returned when the user provided default gateway (v4/v6) is not valid.
var errInvalidGateway = errdefs.InvalidParameter(errors.New("default gateway ip must be part of the network"))
// invalidNetworkIDError is returned when the passed
// network id for an existing network is not a known id.
type invalidNetworkIDError string
func (e invalidNetworkIDError) Error() string {
return fmt.Sprintf("invalid network id %s", string(e))
}
// NotFound denotes the type of this error
func (e invalidNetworkIDError) NotFound() {}
// invalidEndpointIDError is returned when the passed
// endpoint id is not valid.
type invalidEndpointIDError string
func (e invalidEndpointIDError) Error() string {
return fmt.Sprintf("invalid endpoint id: %s", string(e))
}
// InvalidParameter denotes the type of this error
func (e invalidEndpointIDError) InvalidParameter() {}
// endpointNotFoundError is returned when the no endpoint
// with the passed endpoint id is found.
type endpointNotFoundError string
func (e endpointNotFoundError) Error() string {
return fmt.Sprintf("endpoint not found: %s", string(e))
}
// NotFound denotes the type of this error
func (e endpointNotFoundError) NotFound() {}