diff --git a/api/opds_for_distributors.py b/api/opds_for_distributors.py index 421f4ec883..88d5f753f8 100644 --- a/api/opds_for_distributors.py +++ b/api/opds_for_distributors.py @@ -357,7 +357,10 @@ def update_work_for_edition(self, *args, **kwargs): pool, work = super().update_work_for_edition( *args, is_open_access=False, **kwargs ) - pool.unlimited_access = True + + if pool: + pool.unlimited_access = True + return pool, work @classmethod diff --git a/core/opds_import.py b/core/opds_import.py index 7fc4dc618b..6b52d77406 100644 --- a/core/opds_import.py +++ b/core/opds_import.py @@ -524,6 +524,12 @@ def import_from_feed(self, feed, feed_url=None): if work: works[key] = work except Exception as e: + logging.warning( + f"Non-fatal exception: Failed to import item - import will continue: " + f"identifier={key}; collection={self.collection.name}; " + f"data_source={self.data_source}; exception={e}", + stack_info=True, + ) identifier, ignore = Identifier.parse_urn(self._db, key) data_source = self.data_source failure = CoverageFailure(