mirror of
https://github.com/mastodon/mastodon.git
synced 2026-08-20 06:05:54 -05:00
Wrap connection errors in Webfinger#perform (#40135)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user