mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
chore: improve error message around gitaskpass failures (#9407)
This commit is contained in:
@ -44,7 +44,13 @@ func (r *RootCmd) gitAskpass() *clibase.Cmd {
|
||||
if errors.As(err, &apiError) && apiError.StatusCode() == http.StatusNotFound {
|
||||
// This prevents the "Run 'coder --help' for usage"
|
||||
// message from occurring.
|
||||
cliui.Errorf(inv.Stderr, "%s\n", apiError.Message)
|
||||
lines := []string{apiError.Message}
|
||||
if apiError.Detail != "" {
|
||||
lines = append(lines, apiError.Detail)
|
||||
}
|
||||
cliui.Warn(inv.Stderr, "Coder was unable to handle this git request. The default git behavior will be used instead.",
|
||||
lines...,
|
||||
)
|
||||
return cliui.Canceled
|
||||
}
|
||||
return xerrors.Errorf("get git token: %w", err)
|
||||
|
Reference in New Issue
Block a user