Merge pull request #209 from mouse-reeve/connector-errors
Raise errors when connectors fail
This commit is contained in:
@ -9,6 +9,10 @@ from django.db import transaction
|
||||
from bookwyrm import models
|
||||
|
||||
|
||||
class ConnectorException(Exception):
|
||||
''' when the connector can't do what was asked '''
|
||||
|
||||
|
||||
class AbstractConnector(ABC):
|
||||
''' generic book data connector '''
|
||||
|
||||
@ -128,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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user