From 20109b45da838ad1967710b63e200bc17b5f8866 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Mon, 2 Jan 2023 09:34:31 +0100 Subject: [PATCH] Fail gracefully when looking reply actor --- app/admin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/admin.py b/app/admin.py index 32f6b14..226b193 100644 --- a/app/admin.py +++ b/app/admin.py @@ -189,8 +189,11 @@ async def admin_new( content += f"{in_reply_to_object.actor.handle} " for tag in in_reply_to_object.tags: if tag.get("type") == "Mention" and tag["name"] != LOCAL_ACTOR.handle: - mentioned_actor = await fetch_actor(db_session, tag["href"]) - content += f"{mentioned_actor.handle} " + try: + mentioned_actor = await fetch_actor(db_session, tag["href"]) + content += f"{mentioned_actor.handle} " + except Exception: + logger.exception(f"Failed to lookup {mentioned_actor}") # Copy the content warning if any if in_reply_to_object.summary: