start on incorrect function error handling
This commit is contained in:
parent
d5954e2e94
commit
02e9fa086d
2 changed files with 12 additions and 0 deletions
|
|
@ -176,6 +176,12 @@ func mainRun() exitCode {
|
|||
|
||||
printError(stderr, err, cmd, hasDebug)
|
||||
|
||||
if strings.Contains(err.Error(), "Incorrect function") {
|
||||
fmt.Fprintln(stderr, "You appear to be running in MinTTY without pseudo terminal support.")
|
||||
fmt.Fprintln(stderr, "To learn about workarounds for this error, gh help mintty")
|
||||
return exitError
|
||||
}
|
||||
|
||||
var httpErr api.HTTPError
|
||||
if errors.As(err, &httpErr) && httpErr.StatusCode == 401 {
|
||||
fmt.Fprintln(stderr, "hint: try authenticating with `gh auth login`")
|
||||
|
|
|
|||
|
|
@ -6,6 +6,12 @@ import (
|
|||
)
|
||||
|
||||
var HelpTopics = map[string]map[string]string{
|
||||
"mintty": {
|
||||
"short": "Information about using gh with MinTTY",
|
||||
"long": heredoc.Doc(`
|
||||
TODO
|
||||
`),
|
||||
},
|
||||
"environment": {
|
||||
"short": "Environment variables that can be used with gh",
|
||||
"long": heredoc.Doc(`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue