agisboye / app-store-server-api

A Node.js client for the App Store Server API
MIT License
210 stars 32 forks source link

Any chance to add 403 into error path of makeRequest? #33

Closed lucaspang closed 1 year ago

lucaspang commented 1 year ago

I am currently developing subscription extension and some errors are from status code 403 4030004: Subscription Extension Ineligible 4030005: Subscription Max Extension 4030007: Family Shared Subscription Extension Ineligible Right now all these errors are grouped to unknown error. Thank you!

agisboye commented 1 year ago

Have a look at AppStoreError. You can check the errorCode property to see which error you have.

lucaspang commented 1 year ago

Thank you for replying. If the result.status is 403 in makeRequest(Line 150), it will fallback to default case to return a general unknown error, instead of the AppStoreError, only 400, 404 and 500 will pass along with the apple errorCode.

agisboye commented 1 year ago

Good point 😊 I've added both 403 and 429. Apple doesn't have an overview over all the status codes they use so if I've missed any other ones, let me know.