class RuboCop::Cop::Lint::UselessElseWithoutRescue

This cop checks for useless `else` in `begin..end` without `rescue`.

@example

begin
  do_something
else
  handle_errors # This will never be run.
end

Constants

MSG

Private Instance Methods

alternative_message(_diagnostic) click to toggle source
# File lib/rubocop/cop/lint/useless_else_without_rescue.rb, line 25
def alternative_message(_diagnostic)
  MSG
end
relevant_diagnostic?(diagnostic) click to toggle source
# File lib/rubocop/cop/lint/useless_else_without_rescue.rb, line 21
def relevant_diagnostic?(diagnostic)
  diagnostic.reason == :useless_else
end