From 2bb3b70454ff4b8ba46185ac6c95a148c3838182 Mon Sep 17 00:00:00 2001 From: alpaca-tc Date: Sat, 6 May 2017 19:55:59 +0900 Subject: [PATCH] Handling failed http response (#2823) --- app/services/follow_remote_account_service.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/follow_remote_account_service.rb b/app/services/follow_remote_account_service.rb index 0b5abf58a2..1e8a53c2d4 100644 --- a/app/services/follow_remote_account_service.rb +++ b/app/services/follow_remote_account_service.rb @@ -75,6 +75,7 @@ class FollowRemoteAccountService < BaseService def get_feed(url) 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)] end