Sha256: 8d62937ab007fece0b3219a5efe92be0821d06a6f1058478f49ce79ef556958c

Contents?: true

Size: 384 Bytes

Versions: 5

Compression:

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

          warning(node, :expression) unless body_node
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubocop-0.15.0 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.14.1 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.14.0 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.13.1 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.13.0 lib/rubocop/cop/lint/handle_exceptions.rb