-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider add error type for request apple store api #229
Labels
Comments
The 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
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.The text was updated successfully, but these errors were encountered: