mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
Use catch-all requests exception
This commit is contained in:
parent
95a19a44f8
commit
7a44a9b516
1 changed files with 3 additions and 4 deletions
|
@ -2,11 +2,10 @@
|
|||
from abc import ABC, abstractmethod
|
||||
from dataclasses import asdict, dataclass
|
||||
import logging
|
||||
from urllib3.exceptions import RequestError
|
||||
|
||||
from django.db import transaction
|
||||
import requests
|
||||
from requests.exceptions import SSLError
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
from bookwyrm import activitypub, models, settings
|
||||
from .connector_manager import load_more_data, ConnectorException
|
||||
|
@ -237,7 +236,7 @@ def get_data(url, params=None, timeout=10):
|
|||
},
|
||||
timeout=timeout,
|
||||
)
|
||||
except (RequestError, SSLError, requests.ConnectionError, ConnectionError) as err:
|
||||
except RequestException as err:
|
||||
logger.exception(err)
|
||||
raise ConnectorException()
|
||||
|
||||
|
@ -262,7 +261,7 @@ def get_image(url, timeout=10):
|
|||
},
|
||||
timeout=timeout,
|
||||
)
|
||||
except (RequestError, SSLError) as err:
|
||||
except RequestException as err:
|
||||
logger.exception(err)
|
||||
return None
|
||||
if not resp.ok:
|
||||
|
|
Loading…
Reference in a new issue