From fffdd82571689577db86849ec633588e6532dab3 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 29 Oct 2023 12:40:48 +0100 Subject: [PATCH] Fediverse: Catch URLErrors raised when checking webfinger support --- plugins/Fediverse/plugin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/Fediverse/plugin.py b/plugins/Fediverse/plugin.py index ab8607193..4c2157863 100644 --- a/plugins/Fediverse/plugin.py +++ b/plugins/Fediverse/plugin.py @@ -177,9 +177,15 @@ class Fediverse(callbacks.PluginRegexp): def _has_webfinger_support(self, hostname): if hostname not in self._webfinger_support_cache: - self._webfinger_support_cache[hostname] = ap.has_webfinger_support( - hostname - ) + try: + self._webfinger_support_cache[hostname] = ap.has_webfinger_support( + hostname + ) + except Exception as e: + self.log.error( + "Checking Webfinger support for %s raised %s", hostname, e + ) + return False return self._webfinger_support_cache[hostname] def _get_actor(self, irc, username):