Class: Rubocop::Cop::HandleExceptions

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/handle_exceptions.rb

Constant Summary collapse

MSG =
'Do not suppress exceptions.'

Instance Attribute Summary

Attributes inherited from Cop

#debug, #disabled_lines, #offences

Instance Method Summary collapse

Methods inherited from Cop

#add_offence, cop_name, #has_report?, #ignore_node, inherited, #initialize, #inspect, #name, #on_comment

Constructor Details

This class inherits a constructor from Rubocop::Cop::Cop

Instance Method Details

#on_resbody(node) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/rubocop/cop/handle_exceptions.rb', line 8

def on_resbody(node)
  _exc_list_node, _exc_var_node, body_node = *node

  add_offence(:warning, node.loc.line, MSG) if body_node.type == :nil

  super
end