method
handle_unexpected_args
rails latest stable - Class:
ActiveSupport::EventReporter
handle_unexpected_args(name_or_object, payload, kwargs)private
No documentation available.
# File activesupport/lib/active_support/event_reporter.rb, line 579
def handle_unexpected_args(name_or_object, payload, kwargs)
message = <<~MESSAGE
Rails.event.notify accepts either an event object, a payload hash, or keyword arguments.
Received: #{name_or_object.inspect}, #{payload.inspect}, #{kwargs.inspect}
MESSAGE
if raise_on_error?
raise ArgumentError, message
else
ActiveSupport.error_reporter.report(ArgumentError.new(message), handled: true)
end
end