From 41cef9bdfd5540185cbb00ad9e9cee0402bd30b6 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 10 Feb 2021 17:54:49 -0800 Subject: [PATCH] Catch expand book data load error --- bookwyrm/connectors/abstract_connector.py | 3 ++- bookwyrm/connectors/openlibrary.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bookwyrm/connectors/abstract_connector.py b/bookwyrm/connectors/abstract_connector.py index 2cbcda47..527d2f42 100644 --- a/bookwyrm/connectors/abstract_connector.py +++ b/bookwyrm/connectors/abstract_connector.py @@ -239,7 +239,8 @@ def get_image(url): 'User-Agent': settings.USER_AGENT, }, ) - except (RequestError, SSLError): + except (RequestError, SSLError) as e: + logger.exception(e) return None if not resp.ok: return None diff --git a/bookwyrm/connectors/openlibrary.py b/bookwyrm/connectors/openlibrary.py index cd196d27..a767a45a 100644 --- a/bookwyrm/connectors/openlibrary.py +++ b/bookwyrm/connectors/openlibrary.py @@ -142,7 +142,12 @@ class Connector(AbstractConnector): work = book.parent_work # we can mass download edition data from OL to avoid repeatedly querying - edition_options = self.load_edition_data(work.openlibrary_key) + try: + edition_options = self.load_edition_data(work.openlibrary_key) + except ConnectorException: + # who knows, man + return + for edition_data in edition_options.get('entries'): # does this edition have ANY interesting data? if ignore_edition(edition_data):