Skip to content

Commit

Permalink
Fix confusing error messages around help for 'vault auth' (#4058)
Browse files Browse the repository at this point in the history
Fixes #4056
  • Loading branch information
jefferai authored Mar 1, 2018
1 parent 0cd6c83 commit 8f2eed8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions command/auth_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,16 @@ func (c *AuthHelpCommand) Run(args []string) int {
authPath := ensureTrailingSlash(sanitizePath(args[0]))
auth, ok := auths[authPath]
if !ok {
c.UI.Error(fmt.Sprintf(
"Error retrieving help: unknown auth method: %s", authType))
c.UI.Warn(fmt.Sprintf(
"No auth method available on the server at %q", authPath))
return 1
}

authHandler, ok = c.Handlers[auth.Type]
if !ok {
c.UI.Error(wrapAtLength(fmt.Sprintf(
"INTERNAL ERROR! Found an auth method enabled at %s, but "+
"its type %q is not registered in Vault. This is a bug and should "+
"be reported. Please open an issue at github.com/hashicorp/vault.",
authPath, authType)))
c.UI.Warn(wrapAtLength(fmt.Sprintf(
"No method-specific CLI handler available for auth method %q",
authType)))
return 2
}
}
Expand Down

0 comments on commit 8f2eed8

Please sign in to comment.