about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2017-07-20 11:24:32 -0400
committerGitHub <noreply@github.com>2017-07-20 11:24:32 -0400
commite7edb4d1eeba6c12a1c71271faa30d2bbf00d054 (patch)
treef373d05c4ea43bd335910f3603fab3d866a2486e /app/workers
parentd2352246920800e491466d84b0146feb4d1d791f (diff)
parent1fcdaafa6fbe6d746a096c33263d76e6819da46d (diff)
Merge pull request #87 from tootsuite/master
merge upstream
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/import_worker.rb6
-rw-r--r--app/workers/pubsubhubbub/delivery_worker.rb2
-rw-r--r--app/workers/pubsubhubbub/distribution_worker.rb4
3 files changed, 6 insertions, 6 deletions
diff --git a/app/workers/import_worker.rb b/app/workers/import_worker.rb
index 90a226206..27cc6b365 100644
--- a/app/workers/import_worker.rb
+++ b/app/workers/import_worker.rb
@@ -44,7 +44,7 @@ class ImportWorker
         target_account = ResolveRemoteAccountService.new.call(row.first)
         next if target_account.nil?
         MuteService.new.call(from_account, target_account)
-      rescue Goldfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError
+      rescue Mastodon::UnexpectedResponseError, HTTP::Error, OpenSSL::SSL::SSLError
         next
       end
     end
@@ -56,7 +56,7 @@ class ImportWorker
         target_account = ResolveRemoteAccountService.new.call(row.first)
         next if target_account.nil?
         BlockService.new.call(from_account, target_account)
-      rescue Goldfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError
+      rescue Mastodon::UnexpectedResponseError, HTTP::Error, OpenSSL::SSL::SSLError
         next
       end
     end
@@ -66,7 +66,7 @@ class ImportWorker
     import_rows.each do |row|
       begin
         FollowService.new.call(from_account, row.first)
-      rescue Mastodon::NotPermittedError, ActiveRecord::RecordNotFound, Goldfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError
+      rescue Mastodon::NotPermittedError, ActiveRecord::RecordNotFound, Mastodon::UnexpectedResponseError, HTTP::Error, OpenSSL::SSL::SSLError
         next
       end
     end
diff --git a/app/workers/pubsubhubbub/delivery_worker.rb b/app/workers/pubsubhubbub/delivery_worker.rb
index 2e1101b93..035a59048 100644
--- a/app/workers/pubsubhubbub/delivery_worker.rb
+++ b/app/workers/pubsubhubbub/delivery_worker.rb
@@ -23,7 +23,7 @@ class Pubsubhubbub::DeliveryWorker
   def process_delivery
     payload_delivery
 
-    raise "Delivery failed for #{subscription.callback_url}: HTTP #{payload_delivery.code}" unless response_successful?
+    raise Mastodon::UnexpectedResponseError, payload_delivery unless response_successful?
 
     subscription.touch(:last_successful_delivery_at)
   end
diff --git a/app/workers/pubsubhubbub/distribution_worker.rb b/app/workers/pubsubhubbub/distribution_worker.rb
index 9c1fa76cb..ce467d18b 100644
--- a/app/workers/pubsubhubbub/distribution_worker.rb
+++ b/app/workers/pubsubhubbub/distribution_worker.rb
@@ -22,7 +22,7 @@ class Pubsubhubbub::DistributionWorker
   def distribute_public!(stream_entries)
     return if stream_entries.empty?
 
-    @payload = Ostatus::AtomSerializer.render(Ostatus::AtomSerializer.new.feed(@account, stream_entries))
+    @payload = OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, stream_entries))
 
     Pubsubhubbub::DeliveryWorker.push_bulk(@subscriptions) do |subscription|
       [subscription.id, @payload]
@@ -32,7 +32,7 @@ class Pubsubhubbub::DistributionWorker
   def distribute_hidden!(stream_entries)
     return if stream_entries.empty?
 
-    @payload = Ostatus::AtomSerializer.render(Ostatus::AtomSerializer.new.feed(@account, stream_entries))
+    @payload = OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, stream_entries))
     @domains = @account.followers.domains
 
     Pubsubhubbub::DeliveryWorker.push_bulk(@subscriptions.reject { |s| !allowed_to_receive?(s.callback_url, s.domain) }) do |subscription|