module RuboCop::Cop::RescueNode

def modifier_locations

def modifier_locations
  @modifier_locations ||= processed_source.tokens.select(&:rescue_modifier?).map!(&:pos)
end

def rescue_modifier?(node)

def rescue_modifier?(node)
  return false unless node.respond_to?(:resbody_type?)
  node.resbody_type? && modifier_locations.include?(node.loc.keyword)
end

def rescued_exceptions(resbody)

Deprecated:
  • Use ResbodyNode#exceptions instead
def rescued_exceptions(resbody)
  rescue_group, = *resbody
  if rescue_group
    rescue_group.values
  else
    []
  end
end