mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-28 19:10:35 +00:00
Log errors in conenctor search
This commit is contained in:
parent
21f67c9e28
commit
d7db6d50ba
1 changed files with 3 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
''' functionality outline for a book data connector '''
|
||||
from abc import ABC, abstractmethod
|
||||
from dataclasses import dataclass
|
||||
import logging
|
||||
from urllib3.exceptions import RequestError
|
||||
|
||||
from django.db import transaction
|
||||
|
@ -11,6 +12,7 @@ from requests.exceptions import SSLError
|
|||
from bookwyrm import activitypub, models
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
class ConnectorException(HTTPError):
|
||||
''' when the connector can't do what was asked '''
|
||||
|
||||
|
@ -49,6 +51,7 @@ class AbstractMinimalConnector(ABC):
|
|||
try:
|
||||
data = resp.json()
|
||||
except ValueError as e:
|
||||
logger.exception(e)
|
||||
raise ConnectorException('Unable to parse json response', e)
|
||||
results = []
|
||||
|
||||
|
|
Loading…
Reference in a new issue