Fix three minor issues: (#4022)

* If passing a private key without specifying it in URL syntax, give a
  proper error message (previously we were only making sure it was a
  scheme we knew how to handle, but we need to also be more informative
  if it's not a URL at all)

* If the handshake from the proxy fails, don't hang, just exit

* Update some error messages to use capitalization in line with our
  standard CLI error format
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2023-11-08 12:30:54 -05:00
1 parent 8e83cc87d3
commit cf3900a906
2 files changed
+9 -7

No files matched your search

@@ -84,7 +84,7 @@ func extraSshPrivateKeyFlagHandlingFuncImpl(c *SshPrivateKeyCommand, _ *base.Fla
privateKey, err := parseutil.MustParsePath(c.flagPrivateKey)
switch {
case err == nil:
case errors.Is(err, parseutil.ErrNotParsed):
case errors.Is(err, parseutil.ErrNotAUrl), errors.Is(err, parseutil.ErrNotParsed):
c.UI.Error("Private key flag must be used with env:// or file:// syntax")
return false
default: