instance method
handle_unexpected_args
Ruby on Rails edge
Since v8.1.3.1 Private — implementation detail, not part of the public APIAvailable in: v8.1.3.1 edge
Signature
handle_unexpected_args(name_or_object, payload, kwargs)
No documentation comment.
Parameters
-
name_or_objectreq -
payloadreq -
kwargsreq
Source
# File activesupport/lib/active_support/event_reporter.rb, line 648
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
Defined in activesupport/lib/active_support/event_reporter.rb line 648
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::EventReporter