From a0bbeafb045441543f7bb9f959e7af184550f7d3 Mon Sep 17 00:00:00 2001 From: Daigo 3 Dango Date: Sat, 23 Sep 2017 23:14:06 -1000 Subject: [PATCH] Suppress backtrace when failed to communicate with a remote instance (#5076) --- app/workers/activitypub/delivery_worker.rb | 2 +- app/workers/pubsubhubbub/delivery_worker.rb | 2 +- app/workers/pubsubhubbub/subscribe_worker.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/workers/activitypub/delivery_worker.rb b/app/workers/activitypub/delivery_worker.rb index cd67b67108..a4e8293434 100644 --- a/app/workers/activitypub/delivery_worker.rb +++ b/app/workers/activitypub/delivery_worker.rb @@ -16,7 +16,7 @@ class ActivityPub::DeliveryWorker raise Mastodon::UnexpectedResponseError, @response unless response_successful? rescue => e - raise e.class, "Delivery failed for #{inbox_url}: #{e.message}" + raise e.class, "Delivery failed for #{inbox_url}: #{e.message}", e.backtrace[0] end private diff --git a/app/workers/pubsubhubbub/delivery_worker.rb b/app/workers/pubsubhubbub/delivery_worker.rb index 88645cf338..110b8bf162 100644 --- a/app/workers/pubsubhubbub/delivery_worker.rb +++ b/app/workers/pubsubhubbub/delivery_worker.rb @@ -17,7 +17,7 @@ class Pubsubhubbub::DeliveryWorker @payload = payload process_delivery unless blocked_domain? rescue => e - raise e.class, "Delivery failed for #{subscription&.callback_url}: #{e.message}" + raise e.class, "Delivery failed for #{subscription&.callback_url}: #{e.message}", e.backtrace[0] end private diff --git a/app/workers/pubsubhubbub/subscribe_worker.rb b/app/workers/pubsubhubbub/subscribe_worker.rb index 7560c2671f..e350973e1e 100644 --- a/app/workers/pubsubhubbub/subscribe_worker.rb +++ b/app/workers/pubsubhubbub/subscribe_worker.rb @@ -29,6 +29,6 @@ class Pubsubhubbub::SubscribeWorker logger.debug "PuSH re-subscribing to #{account.acct}" ::SubscribeService.new.call(account) rescue => e - raise e.class, "Subscribe failed for #{account&.acct}: #{e.message}" + raise e.class, "Subscribe failed for #{account&.acct}: #{e.message}", e.backtrace[0] end end