From 098998084d7b5956e523337fc9e9fe13f0310432 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Sat, 28 Sep 2024 06:56:27 -0400 Subject: [PATCH] catch `ClientConnectorError` when fetching actor --- relay/views/activitypub.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/relay/views/activitypub.py b/relay/views/activitypub.py index 50b4bb6..00a1d76 100644 --- a/relay/views/activitypub.py +++ b/relay/views/activitypub.py @@ -1,6 +1,7 @@ import aputils import traceback +from aiohttp import ClientConnectorError from aiohttp.web import Request from blib import HttpError @@ -104,6 +105,10 @@ class ActorView(View): logging.debug('HTTP Status %i: %s', e.status, e.message) raise HttpError(400, 'failed to fetch actor') + except ClientConnectorError as e: + logging.warning('Error when trying to fetch actor: %s, %s', self.signature.keyid, str(e)) + raise HttpError(400, 'failed to fetch actor') + except Exception: traceback.print_exc() raise HttpError(500, 'unexpected error when fetching actor')