Prechádzať zdrojové kódy

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>
Sebastiaan van Stijn 2 rokov pred
rodič
commit
7f0cf432e9
2 zmenil súbory, kde vykonal 1 pridanie a 9 odobranie
  1. 0 8
      client/errors.go
  2. 1 1
      client/plugin_install.go

+ 0 - 8
client/errors.go

@@ -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 {

+ 1 - 1
client/plugin_install.go

@@ -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