mirror of
https://github.com/Leseratte10/acsm-calibre-plugin.git
synced 2024-12-22 17:29:56 +06:00
Ignore HTTP500 in optional notifications
This commit is contained in:
parent
1fa8e28c53
commit
5451766f0a
@ -33,6 +33,8 @@
|
||||
# fix ACSM files from Google Play books (no metadata node),
|
||||
# allow converting an anonymous auth to an AdobeID auth,
|
||||
# update python-cryptography from 3.4.8 to 36.0.1, update python-rsa from 4.7.2 to 4.8.
|
||||
# Currently in development:
|
||||
# Ignore fatal HTTP errors during optional fulfillment notifications.
|
||||
|
||||
PLUGIN_NAME = "DeACSM"
|
||||
PLUGIN_VERSION_TUPLE = (0, 0, 15)
|
||||
|
@ -271,7 +271,13 @@ def sendPOSTHTTPRequest(URL: str, document: bytes, type: str, returnRC = False):
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
req = urllib.request.Request(url=URL, headers=headers, data=document)
|
||||
handler = urllib.request.urlopen(req, context=ctx)
|
||||
try:
|
||||
handler = urllib.request.urlopen(req, context=ctx)
|
||||
except urllib.error.HTTPError as err:
|
||||
# This happens with HTTP 500 and related errors.
|
||||
print("Post request caused HTTPError %d" % (err.code))
|
||||
return err.code, "Post request caused HTTPException"
|
||||
|
||||
|
||||
ret_code = handler.getcode()
|
||||
if (ret_code == 204 and returnRC):
|
||||
|
Loading…
Reference in New Issue
Block a user