libnetwork/drivers/bridge: remove ErrInvalidMtu

It's a generic errdefs.ErrInvalidParameter, and the type itself is not
used as sentinel error anywhere.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-01-28 13:37:35 +01:00
parent 2f42aa0e26
commit 3a9f4e0146
2 changed files with 1 additions and 11 deletions

View File

@@ -235,7 +235,7 @@ func ValidateFixedCIDRV6(val string) error {
// Whatever can be assessed a priori before attempting any programming.
func (c *networkConfiguration) Validate() error {
if c.Mtu < 0 {
return ErrInvalidMtu(c.Mtu)
return errdefs.InvalidParameter(fmt.Errorf("invalid MTU number: %d", c.Mtu))
}
if c.EnableIPv4 {

View File

@@ -16,16 +16,6 @@ func (eig *ErrInvalidGateway) Error() string {
// InvalidParameter denotes the type of this error
func (eig *ErrInvalidGateway) InvalidParameter() {}
// ErrInvalidMtu is returned when the user provided MTU is not valid.
type ErrInvalidMtu int
func (eim ErrInvalidMtu) Error() string {
return fmt.Sprintf("invalid MTU number: %d", int(eim))
}
// InvalidParameter denotes the type of this error
func (eim ErrInvalidMtu) InvalidParameter() {}
// InvalidNetworkIDError is returned when the passed
// network id for an existing network is not a known id.
type InvalidNetworkIDError string