Sha256: d63c54ef82e0851d9e6cd9c07a85bf544a873917bef57d5d377e11faffbe3dc8

Contents?: true

Size: 980 Bytes

Versions: 6837

Compression:

Stored size: 980 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Lint
      # This cop checks for *rescue* blocks with no body.
      #
      # @example
      #
      #   # bad
      #
      #   def some_method
      #     do_something
      #   rescue
      #     # do nothing
      #   end
      #
      # @example
      #
      #   # bad
      #
      #   begin
      #     do_something
      #   rescue
      #     # do nothing
      #   end
      #
      # @example
      #
      #   # good
      #
      #   def some_method
      #     do_something
      #   rescue
      #     handle_exception
      #   end
      #
      # @example
      #
      #   # good
      #
      #   begin
      #     do_something
      #   rescue
      #     handle_exception
      #   end
      class HandleExceptions < Cop
        MSG = 'Do not suppress exceptions.'.freeze

        def on_resbody(node)
          add_offense(node) unless node.body
        end
      end
    end
  end
end

Version data entries

6,837 entries across 6,831 versions & 26 rubygems

Version Path
cybrid_api_id_ruby-0.123.179 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.179 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.177 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_id_ruby-0.123.177 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.176 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_id_ruby-0.123.176 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.175 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_id_ruby-0.123.175 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_id_ruby-0.123.174 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.174 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_id_ruby-0.123.173 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.173 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
ory-client-1.16.3 vendor/bundle/ruby/3.1.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.172 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_id_ruby-0.123.172 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_id_ruby-0.123.171 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.171 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_id_ruby-0.123.170 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.170 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb
cybrid_api_organization_ruby-0.123.163 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/lint/handle_exceptions.rb