Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7962: more_informative_type_error.diff

File more_informative_type_error.diff, 0.9 kB (added by matt, 2 months ago)

same patch as the original but now applying to the proper file and doing an inspect on the value.

  • trunk/actionpack/lib/action_controller/request.rb

    old new  
    690690      end 
    691691 
    692692      def type_conflict!(klass, value) 
    693         raise TypeError, "Conflicting types for parameter containers. Expected an instance of #{klass} but found an instance of #{value.class}. This can be caused by colliding Array and Hash parameters like qs[]=value&qs[key]=value.
     693        raise TypeError, "Conflicting types for parameter containers. Expected an instance of #{klass} but found an instance of #{value.class}. This can be caused by colliding Array and Hash parameters like qs[]=value&qs[key]=value. (The parameters received were #{value.inspect}.)
    694694      end 
    695695  end 
    696696