class RuboCop::Cop::Style::ImplicitRuntimeError
raise ArgumentError, ‘Error message here’
# good
raise ‘Error message here’
# bad
@example
nature of the error.)
might prefer to use exception classes which more precisely identify the
explicit exception class. (This raises a ‘RuntimeError`. Some projects
This cop checks for `raise` or `fail` statements which do not specify an
def on_send(node)
def on_send(node) implicit_runtime_error_raise_or_fail(node) do |method| add_offense(node, message: format(MSG, method: method)) end end