We transitioned most functionality of docker/errdefs to containerd errdefs module, and the docker/errdefs package should no longer be used. Because of that, there will no longer be ambiguity, so we can remove the aliases for this package, and use it as "errdefs". Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
32 lines
603 B
Go
32 lines
603 B
Go
package container
|
|
|
|
import "github.com/containerd/errdefs"
|
|
|
|
func invalidParameter(err error) error {
|
|
if err == nil || errdefs.IsInvalidArgument(err) {
|
|
return err
|
|
}
|
|
return invalidParameterErr{err}
|
|
}
|
|
|
|
type invalidParameterErr struct{ error }
|
|
|
|
func (invalidParameterErr) InvalidParameter() {}
|
|
func (e invalidParameterErr) Unwrap() error {
|
|
return e.error
|
|
}
|
|
|
|
func notFound(err error) error {
|
|
if err == nil || errdefs.IsNotFound(err) {
|
|
return err
|
|
}
|
|
return notFoundErr{err}
|
|
}
|
|
|
|
type notFoundErr struct{ error }
|
|
|
|
func (notFoundErr) NotFound() {}
|
|
func (e notFoundErr) Unwrap() error {
|
|
return e.error
|
|
}
|