couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <>
Subject _bulk_docs parsing and error handling
Date Thu, 19 Mar 2009 15:30:46 GMT
I see that the response from _bulk_docs has been changed so that it's a
simple JSON array, rather than an object:

    {"id":"doc2","error":"conflict","reason":"Document update conflict."}

So I was checking to see whether the request format had changed to be
consistent with this. I found that a normal _bulk_docs request works

    {"docs":[{...}, {...}, {...}]}

But when I send a request of the form


CouchDB drops the connection on the floor - not even a status 500 line!

So I think the error handling could be made a bit saner. Whether it's worth
changing the _bulk_docs API to allow a simple array is a separate issue.



---- code to replicate ----
set -x


curl -X DELETE "$DB1"
curl -X PUT "$DB1"

# works
curl -svX POST -d "{\"docs\":[
]}" "${DB1}/_bulk_docs"

# fails with connection dropped on the floor
curl -svX POST -d "[
]" "${DB1}/_bulk_docs"

View raw message