mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-26 22:36:21 +01:00
Add callback_url/acct information for Sidekiq PuSH workers Exception. (#4281)
* Add destination informations to exception on SubscribeWorker and DeliveryWorker. * Simplify delivery error message. * Prevent changing Exception type... * fix typo.
This commit is contained in:
parent
f5e228ad2e
commit
994d948c39
@ -8,11 +8,11 @@ module Mastodon
|
||||
|
||||
class UnexpectedResponseError < Error
|
||||
def initialize(response = nil)
|
||||
@response = response
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{@response.uri} returned code #{@response.code}"
|
||||
if response.respond_to? :uri
|
||||
super("#{response.uri} returned code #{response.code}")
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -16,6 +16,8 @@ class Pubsubhubbub::DeliveryWorker
|
||||
@subscription = Subscription.find(subscription_id)
|
||||
@payload = payload
|
||||
process_delivery unless blocked_domain?
|
||||
rescue => e
|
||||
raise e.class, "Delivery failed for #{subscription&.callback_url}: #{e.message}"
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -22,5 +22,7 @@ class Pubsubhubbub::SubscribeWorker
|
||||
account = Account.find(account_id)
|
||||
logger.debug "PuSH re-subscribing to #{account.acct}"
|
||||
::SubscribeService.new.call(account)
|
||||
rescue => e
|
||||
raise e.class, "Subscribe failed for #{account&.acct}: #{e.message}"
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user