Sha256: d2544fccc58ce2f058a6696f5259914e638738088a22f6084e75194e39c1ea24

Contents?: true

Size: 405 Bytes

Versions: 4

Compression:

Stored size: 405 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Lint
      # This cop checks for *rescue* blocks with no body.
      class HandleExceptions < Cop
        MSG = 'Do not suppress exceptions.'

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

          add_offence(:warning, node.loc.expression, MSG) unless body_node
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.12.0 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.11.1 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.11.0 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.10.0 lib/rubocop/cop/lint/handle_exceptions.rb