Skip to content

Commit d723fd9

Browse files
committed
Add debug logging for subscriptions API response
1 parent 8e54090 commit d723fd9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,11 +648,15 @@ func fetchAllSubscriptions() ([]SubscriptionDetail, error) {
648648
return nil, fmt.Errorf("subscriptions list returned %d: %s", resp.StatusCode, string(body))
649649
}
650650

651+
bodyBytes, _ := io.ReadAll(resp.Body)
652+
log.Printf("Subscriptions API response (page %d): %s", page, string(bodyBytes))
653+
651654
var result SubscriptionListResponse
652-
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
655+
if err := json.Unmarshal(bodyBytes, &result); err != nil {
653656
return nil, fmt.Errorf("failed to decode subscriptions list: %w", err)
654657
}
655658

659+
log.Printf("Parsed %d subscriptions from page %d", len(result.Subscriptions), page)
656660
allSubs = append(allSubs, result.Subscriptions...)
657661

658662
if result.NextPage == nil || *result.NextPage == 0 {

0 commit comments

Comments
 (0)