Files
moby/libnetwork/drivers/bridge/errors.go
Sebastiaan van Stijn bbaa8af8f3 libnetwork/drivers/bridge: un-export errors
These errors implement errdefs interfaces, and are only used internally
for convenience. Un-export their implemetations because the types themselves
are not used as sentinel errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-28 19:12:42 +01: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() {}