added a debugging statement on PUT failures
This commit is contained in:
parent
bb93a5bb1f
commit
4bfb69b3ce
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue