Wrap connection errors in Webfinger#perform (#40135)

This commit is contained in:
Claire
2026-08-12 15:57:32 +02:00
parent 170f23bb24
commit b4121ff003
2 changed files with 3 additions and 1 deletions

View File

@@ -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

View File

@@ -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