mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
More error handling in connector/books manager
This commit is contained in:
parent
fe83f5d442
commit
94d5986ff2
3 changed files with 6 additions and 5 deletions
|
@ -26,8 +26,10 @@ def get_or_create_book(remote_id):
|
|||
|
||||
connector = get_or_create_connector(remote_id)
|
||||
|
||||
# raises ConnectorException
|
||||
book = connector.get_or_create_book(remote_id)
|
||||
load_more_data.delay(book.id)
|
||||
if book:
|
||||
load_more_data.delay(book.id)
|
||||
return book
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue