mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-22 21:26:52 +00:00
Handling failed http response (#2823)
This commit is contained in:
parent
fd1e29c3f8
commit
1f15a15621
|
@ -75,6 +75,7 @@ class FollowRemoteAccountService < BaseService
|
||||||
|
|
||||||
def get_feed(url)
|
def get_feed(url)
|
||||||
response = http_client(write: 20, connect: 20, read: 50).get(Addressable::URI.parse(url).normalize)
|
response = http_client(write: 20, connect: 20, read: 50).get(Addressable::URI.parse(url).normalize)
|
||||||
|
raise Goldfinger::Error, "Feed attempt failed for #{url}: HTTP #{response.code}" unless response.code == 200
|
||||||
[response.to_s, Nokogiri::XML(response)]
|
[response.to_s, Nokogiri::XML(response)]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue