mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 17:35:27 +08:00
handle case apple server not accessible
This commit is contained in:
parent
5cf0a4bcfe
commit
d1eb1ea799
1 changed files with 8 additions and 3 deletions
|
@ -299,9 +299,14 @@ def verify_receipt(receipt_data, user, password) -> Optional[AppleSubscription]:
|
|||
https://developer.apple.com/documentation/appstorereceipts/verifyreceipt
|
||||
"""
|
||||
LOG.d("start verify_receipt")
|
||||
r = requests.post(
|
||||
_PROD_URL, json={"receipt-data": receipt_data, "password": password}
|
||||
)
|
||||
try:
|
||||
r = requests.post(
|
||||
_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:
|
||||
LOG.warning("Apple server error, response:%s %s", r, r.content)
|
||||
return None
|
||||
|
|
Loading…
Reference in a new issue