Handle http status 5xx error

This commit is contained in:
Junpei Tsuji
2020-02-20 14:03:07 +09:00
committed by sanjid133
parent d13032442f
commit bb35e9f2a8
2 changed files with 1 additions and 2 deletions

View File

@@ -163,7 +163,6 @@ type (
SubscriptionRetryFlag string `json:"is_in_billing_retry_period,omitempty"`
}
// The HttpStatusResponse struct contains the status code returned by the store
// Used as a workaround to detect when to hit the production appstore or sandbox appstore regardless of receipt type
StatusResponse struct {

View File

@@ -125,7 +125,7 @@ func (c *Client) Verify(ctx context.Context, reqBody IAPRequest, result interfac
}
defer resp.Body.Close()
if resp.StatusCode >= 500 {
return fmt.Errorf("Received http status code %d from the App Store: %w", resp.StatusCode, ErrAppStoreServer)
return "", fmt.Errorf("Received http status code %d from the App Store: %w", resp.StatusCode, ErrAppStoreServer)
}
return c.parseResponse(resp, result, ctx, reqBody)
}