Skip to content

Commit

Permalink
Add SSLError to exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Sep 9, 2022
1 parent 6a63289 commit 6c447e9
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import hashlib
import json
from copy import deepcopy
from ssl import SSLError

from aiohttp import ClientResponseError, ClientSession, ServerConnectionError, web

from aiohttp_apispec import docs

from ipv8.REST.schema import schema

from marshmallow.fields import String

from tribler.core import notifications
Expand Down Expand Up @@ -101,7 +99,8 @@ async def get_torrent_info(self, request):
elif scheme in (HTTP_SCHEME, HTTPS_SCHEME):
try:
response = await query_http_uri(uri)
except (ServerConnectionError, ClientResponseError) as e:
except (ServerConnectionError, ClientResponseError, SSLError) as e:
self._logger.warning(f'Error while querying http uri: {e}')
return RESTResponse({"error": str(e)}, status=HTTP_INTERNAL_SERVER_ERROR)

if response.startswith(b'magnet'):
Expand Down

0 comments on commit 6c447e9

Please sign in to comment.