Skip to content

Commit

Permalink
Expose error stack for plz auth
Browse files Browse the repository at this point in the history
  • Loading branch information
sraturi committed Dec 28, 2023
1 parent 6355f0a commit a77d40b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion actions/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package actions
import (
"github.com/bitcomplete/plz-cli/client/auth"
"github.com/bitcomplete/plz-cli/client/deps"
"github.com/pkg/errors"
"github.com/urfave/cli/v2"
)

func Auth(c *cli.Context) error {
deps := deps.FromContext(c.Context)
auth, err := auth.Prompt(deps.PlzAPIBaseURL)
if err != nil {
return err
return errors.WithStack(err)
}
return auth.SaveToKeyRing()
}
2 changes: 1 addition & 1 deletion auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func Prompt(plzAPIBaseURL string) (*Auth, error) {
httpClient := http.DefaultClient
gitHubAppClientID, err := fetchGitHubAppClientID(httpClient, plzAPIBaseURL)
if err != nil {
return nil, err
return nil, errors.WithStack(err)
}
code, err := device.RequestCode(
httpClient,
Expand Down

0 comments on commit a77d40b

Please sign in to comment.