From b4121ff003b0678e1cb43cb0b5fd9124c4bd23a0 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 12 Aug 2026 15:57:32 +0200 Subject: [PATCH] Wrap connection errors in `Webfinger#perform` (#40135) --- app/lib/webfinger.rb | 2 ++ app/models/remote_follow.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/lib/webfinger.rb b/app/lib/webfinger.rb index aa5bcbe2a7b..67c62a27269 100644 --- a/app/lib/webfinger.rb +++ b/app/lib/webfinger.rb @@ -61,6 +61,8 @@ class Webfinger raise Webfinger::Error, "Invalid JSON in response for #{@uri}" rescue Addressable::URI::InvalidURIError raise Webfinger::Error, "Invalid URI for #{@uri}" + rescue *Mastodon::HTTP_CONNECTION_ERRORS => e + raise Webfinger::Error, "Error performing webfinger query for #{@uri}: #{e}" end private diff --git a/app/models/remote_follow.rb b/app/models/remote_follow.rb index f9719b86707..1022b9a4df1 100644 --- a/app/models/remote_follow.rb +++ b/app/models/remote_follow.rb @@ -66,7 +66,7 @@ class RemoteFollow def acct_resource @acct_resource ||= Webfinger.new("acct:#{acct}").perform - rescue Webfinger::Error, *Mastodon::HTTP_CONNECTION_ERRORS + rescue Webfinger::Error nil end