handle case apple server not accessible
This commit is contained in:
parent
5cf0a4bcfe
commit
d1eb1ea799
|
@ -299,9 +299,14 @@ def verify_receipt(receipt_data, user, password) -> Optional[AppleSubscription]:
|
||||||
https://developer.apple.com/documentation/appstorereceipts/verifyreceipt
|
https://developer.apple.com/documentation/appstorereceipts/verifyreceipt
|
||||||
"""
|
"""
|
||||||
LOG.d("start verify_receipt")
|
LOG.d("start verify_receipt")
|
||||||
|
try:
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
_PROD_URL, json={"receipt-data": receipt_data, "password": password}
|
_PROD_URL, json={"receipt-data": receipt_data, "password": password}
|
||||||
)
|
)
|
||||||
|
except ConnectionError:
|
||||||
|
LOG.warning("cannot call Apple server %s", _PROD_URL)
|
||||||
|
return None
|
||||||
|
|
||||||
if r.status_code >= 500:
|
if r.status_code >= 500:
|
||||||
LOG.warning("Apple server error, response:%s %s", r, r.content)
|
LOG.warning("Apple server error, response:%s %s", r, r.content)
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue