libnetwork: remove ErrInvalidID

It was only returned in a few places, and not used any different than
a "invalid parameter" error, so let's use a standard errdefs.ErrInvalidParameter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-01-27 09:55:02 +01:00
parent 548b0b6290
commit a98ecc5f79
4 changed files with 5 additions and 16 deletions

View File

@@ -14,17 +14,6 @@ func (nsn ErrNoSuchNetwork) Error() string {
// NotFound denotes the type of this error
func (nsn ErrNoSuchNetwork) NotFound() {}
// ErrInvalidID is returned when a query-by-id method is being invoked
// with an empty id parameter
type ErrInvalidID string
func (ii ErrInvalidID) Error() string {
return fmt.Sprintf("invalid id: %s", string(ii))
}
// InvalidParameter denotes the type of this error
func (ii ErrInvalidID) InvalidParameter() {}
// ErrInvalidName is returned when a query-by-name or resource create method is
// invoked with an empty name parameter
type ErrInvalidName string