fixed a typo added when I added more debugging info to the request processing

This commit is contained in:
Matt Aimonetti 2009-03-02 21:26:18 -08:00
parent b1999ac8b7
commit d383c5a7d4

View file

@ -125,10 +125,11 @@ module CouchRest
end
def put(uri, doc = nil)
payload = doc.to_json if doc
begin
JSON.parse(RestClient.post(uri, payload))
JSON.parse(RestClient.put(uri, payload))
rescue Exception => e
raise "Error while sending a POST request #{uri}\npayload: #{payload.inspect}\n#{e}"
raise "Error while sending a PUT request #{uri}\npayload: #{payload.inspect}\n#{e}"
end
end
@ -142,7 +143,11 @@ module CouchRest
def post uri, doc = nil
payload = doc.to_json if doc
JSON.parse(RestClient.post(uri, payload))
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 delete uri