Class: RuboCop::Cop::Lint::NoUntypedRaise

Inherits:
RuboCop::Cop show all
Defined in:
lib/rubocop/cop/lint/no_untyped_raise.rb

Overview

Examples:

# bad
raise 'foo'

# good
raise ArgumentError, 'foo'

Constant Summary collapse

MSG =
"Do not raise untyped exceptions, specify the error type so it can be rescued specifically."

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



18
19
20
21
22
# File 'lib/rubocop/cop/lint/no_untyped_raise.rb', line 18

def on_send(node)
  return unless is_untyped_raise?(node)

  add_offense(node)
end