From 3daed133e07ee98da39bf7975ef2698b58d1bc1d Mon Sep 17 00:00:00 2001 From: Florian Bach Date: Sat, 8 Jan 2022 11:50:55 +0100 Subject: [PATCH] Don't fail if optional notification server is unavailable --- calibre-plugin/libadobeFulfill.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/calibre-plugin/libadobeFulfill.py b/calibre-plugin/libadobeFulfill.py index 893e736..8a9f4ce 100644 --- a/calibre-plugin/libadobeFulfill.py +++ b/calibre-plugin/libadobeFulfill.py @@ -706,7 +706,18 @@ def performFulfillmentNotification(fulfillmentResultToken, forceOptional = False # Debug: Print notify request #print(doc_send) - code, msg = sendRequestDocuRC(doc_send, url) + try: + code, msg = sendRequestDocuRC(doc_send, url) + except: + if not critical: + print("There was an error during an optional fulfillment notification:") + import traceback + traceback.print_exc() + print("Continuing execution ...") + continue + else: + print("Error during critical notification:") + raise try: msg = msg.decode("utf-8")