diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2022-08-23 22:52:36 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2022-08-23 23:21:21 +0200 |
commit | 7f0cf432e98e1a2e2860faa36ec8bdc55d219e12 (patch) | |
tree | 7a6bc25626d78488c966c31ea937341713c37832 | |
parent | c3f0cd7457457f75b32b83b74e291c049194ab37 (diff) |
client: remove redundant pluginPermissionDenied
It was only used in a single location, and only a "convenience" type,
not used to detect a specific error.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
-rw-r--r-- | client/errors.go | 8 | ||||
-rw-r--r-- | client/plugin_install.go | 2 |
2 files changed, 1 insertions, 9 deletions
diff --git a/client/errors.go b/client/errors.go index 67a6babda7..6878144c41 100644 --- a/client/errors.go +++ b/client/errors.go @@ -58,14 +58,6 @@ func (e objectNotFoundError) Error() string { return fmt.Sprintf("Error: No such %s: %s", e.object, e.id) } -type pluginPermissionDenied struct { - name string -} - -func (e pluginPermissionDenied) Error() string { - return "Permission denied while installing plugin " + e.name -} - // 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 |