diff options
author | Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> | 2022-08-31 17:01:56 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 17:01:56 +0900 |
commit | 52f8a4283e4e5b89927b23087bf0c69501816020 (patch) | |
tree | cb23c70fb5a9f7853e087aba039b917b83a3a111 | |
parent | c543c3969282cb6891970a925f2fb0f91287266f (diff) | |
parent | 7f0cf432e98e1a2e2860faa36ec8bdc55d219e12 (diff) |
Merge pull request #44021 from thaJeztah/client_remove_deprecated_errorutils
client: remove deprecated error-utilities
-rw-r--r-- | client/errors.go | 25 | ||||
-rw-r--r-- | client/plugin_install.go | 2 |
2 files changed, 1 insertions, 26 deletions
diff --git a/client/errors.go b/client/errors.go index e5a8a865f9..6878144c41 100644 --- a/client/errors.go +++ b/client/errors.go @@ -58,31 +58,6 @@ func (e objectNotFoundError) Error() string { return fmt.Sprintf("Error: No such %s: %s", e.object, e.id) } -// IsErrUnauthorized returns true if the error is caused -// when a remote registry authentication fails -// -// Deprecated: use errdefs.IsUnauthorized -func IsErrUnauthorized(err error) bool { - return errdefs.IsUnauthorized(err) -} - -type pluginPermissionDenied struct { - name string -} - -func (e pluginPermissionDenied) Error() string { - return "Permission denied while installing plugin " + e.name -} - -// IsErrNotImplemented returns true if the error is a NotImplemented error. -// This is returned by the API when a requested feature has not been -// implemented. -// -// Deprecated: use errdefs.IsNotImplemented -func IsErrNotImplemented(err error) bool { - return errdefs.IsNotImplemented(err) -} - // NewVersionError returns an error if the APIVersion required // if less than the current supported version func (cli *Client) NewVersionError(APIrequired, feature string) error { diff --git a/client/plugin_install.go b/client/plugin_install.go index c8284c5d87..3a740ec4f6 100644 --- a/client/plugin_install.go +++ b/client/plugin_install.go @@ -107,7 +107,7 @@ func (cli *Client) checkPluginPermissions(ctx context.Context, query url.Values, return nil, err } if !accept { - return nil, pluginPermissionDenied{options.RemoteRef} + return nil, errors.Errorf("permission denied while installing plugin %s", options.RemoteRef) } } return privileges, nil |