From d6cc2d0ddb025ebeae24724f9fd4415802dff806 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Fri, 22 Sep 2023 20:14:13 -0300 Subject: [PATCH] Make sure logging message is type safe. --- core/opds_import.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/opds_import.py b/core/opds_import.py index b2fc91472e..3eeebcfd4a 100644 --- a/core/opds_import.py +++ b/core/opds_import.py @@ -512,9 +512,10 @@ def import_from_feed( if work: works[key] = work except Exception as e: + collection_name = self.collection.name if self.collection else "None" logging.warning( f"Non-fatal exception: Failed to import item - import will continue: " - f"identifier={key}; collection={self.collection.name}; " + f"identifier={key}; collection={collection_name}/{self._collection_id}; " f"data_source={self.data_source}; exception={e}", stack_info=True, )