Open bing-h opened 1 year ago
The errCode == 4290000
could meet your requirement, please refer to codes https://github.com/awa/go-iap/blob/master/appstore/api/error.go#L43
func newAppStoreAPIError(b []byte, hd http.Header) (*Error, bool) {
if len(b) == 0 {
return nil, false
}
var rErr appStoreAPIErrorResp
if err := json.Unmarshal(b, &rErr); err != nil {
return nil, false
}
if rErr.ErrorCode == 0 {
return nil, false
}
if rErr.ErrorCode == 4290000 {
retryAfter, err := strconv.ParseInt(hd.Get("Retry-After"), 10, 64)
if err == nil {
return &Error{errorCode: rErr.ErrorCode, errorMessage: rErr.ErrorMessage, retryAfter: retryAfter}, true
}
}
for example,function GetALLSubscriptionStatuses return
(rsp *StatusResponse, err error)
,I hope to retry when apple server return response code 429, maybe return custom error type with field status.