class RuboCop::Cop::Naming::RescuedExceptionsVariableName
def on_resbody(node)
def on_resbody(node) offending_name = variable_name(node) return unless offending_name # Handle nested rescues by only requiring the outer one to use the # configured variable name, so that nested rescues don't use the same # variable. return if node.each_ancestor(:resbody).any? preferred_name = preferred_name(offending_name) return if preferred_name.to_sym == offending_name # check variable shadowing for exception variable return if shadowed_variable_name?(node) range = offense_range(node) message = message(node) add_offense(range, message: message) do |corrector| autocorrect(corrector, node, range, offending_name, preferred_name) end end