Wrap connection errors in Webfinger#perform (#40135)
This commit is contained in:
parent
7a5a849e66
commit
ddfdc1fef3
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user