From bb93a5bb1f758947876b5a07619d0bf884ce5d03 Mon Sep 17 00:00:00 2001 From: Matt Aimonetti Date: Thu, 26 Feb 2009 18:44:39 -0800 Subject: [PATCH] added rescue message to GET request --- lib/couchrest.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/couchrest.rb b/lib/couchrest.rb index 7b77e6a..a6305c3 100644 --- a/lib/couchrest.rb +++ b/lib/couchrest.rb @@ -129,8 +129,12 @@ module CouchRest JSON.parse(RestClient.put(uri, payload)) end - def get uri - JSON.parse(RestClient.get(uri), :max_nesting => false) + def get(uri) + begin + JSON.parse(RestClient.get(uri), :max_nesting => false) + rescue => e + raise "Error while sending a GET request #{uri}\n: #{e}" + end end def post uri, doc = nil