Sha256: 555bcfb94c5a5fad4cea144dc78c05197998ced0e63fdd416edad4941416c918

Contents?: true

Size: 388 Bytes

Versions: 6

Compression:

Stored size: 388 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_offense(node, :expression) unless body_node
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubocop-0.22.0 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.21.0 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.20.1 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.20.0 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.19.1 lib/rubocop/cop/lint/handle_exceptions.rb
rubocop-0.19.0 lib/rubocop/cop/lint/handle_exceptions.rb