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>
This commit is contained in:
parent
c3f0cd7457
commit
7f0cf432e9
|
@ -58,14 +58,6 @@ func (e objectNotFoundError) Error() string {
|
||||||
return fmt.Sprintf("Error: No such %s: %s", e.object, e.id)
|
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
|
// NewVersionError returns an error if the APIVersion required
|
||||||
// if less than the current supported version
|
// if less than the current supported version
|
||||||
func (cli *Client) NewVersionError(APIrequired, feature string) error {
|
func (cli *Client) NewVersionError(APIrequired, feature string) error {
|
||||||
|
|
|
@ -107,7 +107,7 @@ func (cli *Client) checkPluginPermissions(ctx context.Context, query url.Values,
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if !accept {
|
if !accept {
|
||||||
return nil, pluginPermissionDenied{options.RemoteRef}
|
return nil, errors.Errorf("permission denied while installing plugin %s", options.RemoteRef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return privileges, nil
|
return privileges, nil
|
||||||
|
|
Loading…
Reference in New Issue