added a debugging statement on PUT failures

This commit is contained in:
Matt Aimonetti 2009-02-26 19:53:01 -08:00
parent bb93a5bb1f
commit 4bfb69b3ce

View file

@ -124,9 +124,12 @@ module CouchRest
cr.database(parsed[:database])
end
def put uri, doc = nil
payload = doc.to_json if doc
JSON.parse(RestClient.put(uri, payload))
def put(uri, doc = nil)
begin
JSON.parse(RestClient.post(uri, payload))
rescue Exception => e
raise "Error while sending a POST request #{uri}\npayload: #{payload.inspect}\n#{e}"
end
end
def get(uri)