class RuboCop::Cop::Style::ImplicitRuntimeError
This cop checks for `raise` or `fail` statements which do not specify an explicit exception class. (This raises a `RuntimeError`. Some projects might prefer to use exception classes which more precisely identify the nature of the error.)
@example
# bad raise 'Error message here' # good raise ArgumentError, 'Error message here'
Constants
- MSG
Public Instance Methods
on_send(node)
click to toggle source
# File lib/rubocop/cop/style/implicit_runtime_error.rb, line 24 def on_send(node) implicit_runtime_error_raise_or_fail(node) do |method| add_offense(node, message: format(MSG, method: method)) end end