added a debugging statement on PUT failures
This commit is contained in:
parent
bb93a5bb1f
commit
4bfb69b3ce
1 changed files with 6 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue