Raise an error if salmon request response is unsatisfactory (#3960)

th-downstream
ThibG 7 years ago committed by Eugen Rochko
parent 196bd78b60
commit b9e0e43128

@ -13,7 +13,8 @@ class SendInteractionService < BaseService
return if block_notification? return if block_notification?
envelope = salmon.pack(@xml, @source_account.keypair) 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 end
private private

Loading…
Cancel
Save