diff --git a/lib/zester/resource.rb b/lib/zester/resource.rb index 2bcf757..845735e 100644 --- a/lib/zester/resource.rb +++ b/lib/zester/resource.rb @@ -8,11 +8,7 @@ def initialize(client) end def get_results(endpoint, resource_type, params = {}) - begin - Response.new(self.client.perform_get(endpoint, params), resource_type) - rescue Timeout::Error, Exception - Response.new({resource_type => {:message => {:code => "3", :text => "Web services are currently unavailable"}}}, resource_type) - end + Response.new(self.client.perform_get(endpoint, params), resource_type) end end diff --git a/spec/zester/resource_spec.rb b/spec/zester/resource_spec.rb index ada171d..9ff2d59 100644 --- a/spec/zester/resource_spec.rb +++ b/spec/zester/resource_spec.rb @@ -26,13 +26,9 @@ VCR.turn_on! end - it "should rescue a timeout error" do + it "should not rescue a timeout error" do stub_request(:get, "http://www.zillow.com/webservice/GetRateSummary.htm?zws-id=#{ZWS_ID}").to_timeout - response = resource.get_results('GetRateSummary', :rate_summary) - response.success?.should be_false - response.message.should_not be_nil - response.message.code.should == "3" - response.response_code.should == 3 + expect {get_response}.to raise_error(Timeout::Error) end end