Handle http status 5xx error
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user