Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func loginCmd() *cobra.Command {
Use: "login",
Short: "Login to the App Store",
RunE: func(cmd *cobra.Command, args []string) error {
interactive := cmd.Context().Value("interactive").(bool)
interactive := cmd.Context().Value(interactiveKey).(bool)

if password == "" && !interactive {
return errors.New("password is required when not running in interactive mode; use the \"--password\" flag")
Expand Down
4 changes: 4 additions & 0 deletions pkg/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ func (c *client[R]) handleXMLResponse(res *http.Response) (Result[R], error) {
return Result[R]{}, fmt.Errorf("failed to read response body: %w", err)
}

if res.StatusCode == http.StatusTooManyRequests {
return Result[R]{}, fmt.Errorf("rate limited by Apple (HTTP %d): %s", res.StatusCode, strings.TrimSpace(string(body)))
}

var data R

normalizedBody := normalizeXMLPlistBody(body)
Expand Down