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]) cr.database(parsed[:database])
end end
def put uri, doc = nil def put(uri, doc = nil)
payload = doc.to_json if doc begin
JSON.parse(RestClient.put(uri, payload)) JSON.parse(RestClient.post(uri, payload))
rescue Exception => e
raise "Error while sending a POST request #{uri}\npayload: #{payload.inspect}\n#{e}"
end
end end
def get(uri) def get(uri)