about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2017-06-26 19:39:58 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-06-26 19:39:58 +0200
commita91d968cab5120ca389fcc7d6788cafca85e69e7 (patch)
tree3b11248e3da0fea498e36b9b718df885d44f2eb8 /app/services
parent646de92781ba9d211255a7eaf7ebca7b365612f6 (diff)
Raise an error if salmon request response is unsatisfactory (#3960)
Diffstat (limited to 'app/services')
-rw-r--r--app/services/send_interaction_service.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/send_interaction_service.rb b/app/services/send_interaction_service.rb
index 504f41c72..34c8f9e34 100644
--- a/app/services/send_interaction_service.rb
+++ b/app/services/send_interaction_service.rb
@@ -13,7 +13,8 @@ class SendInteractionService < BaseService
     return if block_notification?
 
     envelope = salmon.pack(@xml, @source_account.keypair)
-    salmon.post(@target_account.salmon_url, envelope)
+    delivery = salmon.post(@target_account.salmon_url, envelope)
+    raise "Delivery failed for #{target_account.salmon_url}: HTTP #{delivery.code}" unless delivery.code > 199 && delivery.code < 300
   end
 
   private