method

handle_unexpected_args

rails latest stable - Class: ActiveSupport::EventReporter

Method not available on this version

This method is only available on newer versions. The first available version (v8.1.1) is shown here.

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