Push @response down into Request::Standard, because not all Ruby responses have a response key

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@498439 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2007-01-21 19:58:54 +00:00
parent 18e95b18a7
commit 189ffc877c
2 changed files with 2 additions and 2 deletions

View File

@ -27,10 +27,8 @@ module Solr
# but favor Ruby responses.
@data = eval(ruby_code)
@header = @data['responseHeader']
@response = @data['response']
raise "response should be a hash" unless @data.kind_of? Hash
raise "response header missing" unless @header.kind_of? Hash
raise "response section missing" unless @response.kind_of? Hash
rescue Exception => e
raise Solr::Exception.new("invalid ruby code: #{e}")
end

View File

@ -17,6 +17,8 @@ module Solr
def initialize(ruby_code)
super(ruby_code)
@response = @data['response']
raise "response section missing" unless @response.kind_of? Hash
end
def total_hits