Sha256: f55bc10a5e10e6861be759fdeaa5150ad707c9f0e4e4573723f591bbeaa8ab2d

Contents?: true

Size: 422 Bytes

Versions: 3

Compression:

Stored size: 422 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

          super
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
rubocop-0.9.1 lib/rubocop/cop/lint/handle_exceptions.rb
sabat-rubocop-0.9.0 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.9.0 lib/rubocop/cop/lint/handle_exceptions.rb