mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-23 08:34:13 -05:00
Autofix Rubocop Style/RescueStandardError (#23745)
This commit is contained in:
parent
62c4aecf8f
commit
59c8d43d94
@ -115,6 +115,9 @@ Style/PercentLiteralDelimiters:
|
||||
'%i': '()'
|
||||
'%w': '()'
|
||||
|
||||
Style/RescueStandardError:
|
||||
EnforcedStyle: implicit
|
||||
|
||||
Style/TrailingCommaInArrayLiteral:
|
||||
EnforcedStyleForMultiline: 'comma'
|
||||
|
||||
|
@ -2234,24 +2234,6 @@ Style/RegexpLiteral:
|
||||
- 'lib/mastodon/premailer_webpack_strategy.rb'
|
||||
- 'lib/tasks/mastodon.rake'
|
||||
|
||||
# Offense count: 21
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: implicit, explicit
|
||||
Style/RescueStandardError:
|
||||
Exclude:
|
||||
- 'app/lib/activitypub/activity/move.rb'
|
||||
- 'app/lib/request.rb'
|
||||
- 'app/models/account.rb'
|
||||
- 'app/workers/move_worker.rb'
|
||||
- 'app/workers/scheduler/vacuum_scheduler.rb'
|
||||
- 'lib/mastodon/accounts_cli.rb'
|
||||
- 'lib/mastodon/cli_helper.rb'
|
||||
- 'lib/mastodon/media_cli.rb'
|
||||
- 'lib/mastodon/sidekiq_middleware.rb'
|
||||
- 'lib/mastodon/statuses_cli.rb'
|
||||
- 'lib/mastodon/upgrade_cli.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
||||
|
@ -64,7 +64,7 @@ class RequestPool
|
||||
retries += 1
|
||||
retry
|
||||
end
|
||||
rescue StandardError
|
||||
rescue
|
||||
# If this connection raises errors of any kind, it's
|
||||
# better if it gets reaped as soon as possible
|
||||
|
||||
|
@ -114,7 +114,7 @@ class ImportService < BaseService
|
||||
status || ActivityPub::FetchRemoteStatusService.new.call(uri)
|
||||
rescue HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::UnexpectedResponseError
|
||||
nil
|
||||
rescue StandardError => e
|
||||
rescue => e
|
||||
Rails.logger.warn "Unexpected error when importing bookmark: #{e}"
|
||||
nil
|
||||
end
|
||||
|
@ -165,7 +165,7 @@ module Mastodon
|
||||
|
||||
stats[domain]['activity'] = Oj.load(res.to_s)
|
||||
end
|
||||
rescue StandardError
|
||||
rescue
|
||||
failed.increment
|
||||
ensure
|
||||
processed.increment
|
||||
|
@ -92,7 +92,7 @@ namespace :mastodon do
|
||||
prompt.ok 'Database configuration works! 🎆'
|
||||
db_connection_works = true
|
||||
break
|
||||
rescue StandardError => e
|
||||
rescue => e
|
||||
prompt.error 'Database connection could not be established with this configuration, try again.'
|
||||
prompt.error e.message
|
||||
break unless prompt.yes?('Try again?')
|
||||
@ -132,7 +132,7 @@ namespace :mastodon do
|
||||
redis.ping
|
||||
prompt.ok 'Redis configuration works! 🎆'
|
||||
break
|
||||
rescue StandardError => e
|
||||
rescue => e
|
||||
prompt.error 'Redis connection could not be established with this configuration, try again.'
|
||||
prompt.error e.message
|
||||
break unless prompt.yes?('Try again?')
|
||||
@ -417,7 +417,7 @@ namespace :mastodon do
|
||||
mail = ActionMailer::Base.new.mail to: send_to, subject: 'Test', body: 'Mastodon SMTP configuration works!'
|
||||
mail.deliver
|
||||
break
|
||||
rescue StandardError => e
|
||||
rescue => e
|
||||
prompt.error 'E-mail could not be sent with this configuration, try again.'
|
||||
prompt.error e.message
|
||||
break unless prompt.yes?('Try again?')
|
||||
|
Loading…
Reference in New Issue
Block a user