Fix Style/GuardClause in worker rescues (#35508)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2025-07-25 07:18:46 +00:00
1 parent a863e68d17
commit e5e977c24f
5 files changed
+5 -25

No files matched your search

+1 -5
View File
@@ -22,11 +22,7 @@ class MentionResolveWorker
rescue Mastodon::UnexpectedResponseError => e
response = e.response
if response_error_unsalvageable?(response)
# Give up
else
raise e
end
raise(e) unless response_error_unsalvageable?(response)
end
private
+1 -5
View File
@@ -20,10 +20,6 @@ class RedownloadAvatarWorker
rescue Mastodon::UnexpectedResponseError => e
response = e.response
if response_error_unsalvageable?(response)
# Give up
else
raise e
end
raise(e) unless response_error_unsalvageable?(response)
end
end
+1 -5
View File
@@ -20,10 +20,6 @@ class RedownloadHeaderWorker
rescue Mastodon::UnexpectedResponseError => e
response = e.response
if response_error_unsalvageable?(response)
# Give up
else
raise e
end
raise(e) unless response_error_unsalvageable?(response)
end
end
+1 -5
View File
@@ -20,10 +20,6 @@ class RedownloadMediaWorker
rescue Mastodon::UnexpectedResponseError => e
response = e.response
if response_error_unsalvageable?(response)
# Give up
else
raise e
end
raise(e) unless response_error_unsalvageable?(response)
end
end
+1 -5
View File
@@ -15,10 +15,6 @@ class RemoteAccountRefreshWorker
rescue Mastodon::UnexpectedResponseError => e
response = e.response
if response_error_unsalvageable?(response)
# Give up
else
raise e
end
raise(e) unless response_error_unsalvageable?(response)
end
end