More error handling in connector/books manager

This commit is contained in:
Mouse Reeve 2020-09-30 20:09:25 -07:00
parent fe83f5d442
commit 94d5986ff2
3 changed files with 6 additions and 5 deletions

View file

@ -26,7 +26,9 @@ def get_or_create_book(remote_id):
connector = get_or_create_connector(remote_id)
# raises ConnectorException
book = connector.get_or_create_book(remote_id)
if book:
load_more_data.delay(book.id)
return book

View file

@ -132,6 +132,9 @@ class AbstractConnector(ABC):
edition.author_text = work.author_text
edition.save()
if not edition:
raise ConnectorException('Unable to create book: %s' % remote_id)
return edition

View file

@ -50,10 +50,6 @@ class Connector(AbstractConnector):
)
def get_or_create_book(self, remote_id):
''' this COULD be semi-implemented but I think it shouldn't be used '''
def is_work_data(self, data):
pass