couchdbkit icon indicating copy to clipboard operation
couchdbkit copied to clipboard

BulkSaveError throws empty message.

Open wendall911 opened this issue 13 years ago • 1 comments

Using bulk save, with a list containing the same document twice, BulkSaveError is properly thrown, but error is empty.

try: db.bulk_save([docA, docB, docB]) except BulkSaveError, e: # e is empty

CouchDB will return 201. First instance of docB is good in the response, second instance will contain: {'reason': 'Document update conflict.', 'id': 'docid', 'error': 'conflict'}

wendall911 avatar May 30 '12 21:05 wendall911

hmmm I can't reproduce it here :

>>> try:
...     res = db.save_docs([a, b, b])
... except BulkSaveError, e:
...     print e.errors
...     print e.results
... 
[{u'reason': u'Document update conflict.', u'id': u'afd34ce58d00ff9dd50c54807797ef7a', u'error': u'conflict'}]
[{u'rev': u'2-19dbe7fc82f45d29ac624c0a8c5b0e62', u'ok': True, u'id': u'afd34ce58d00ff9dd50c54807797fe77'}, {u'rev': u'2-672a156b4844da49e0294b6c90476351', u'ok': True, u'id': u'afd34ce58d00ff9dd50c54807797ef7a'}, {u'reason': u'Document update conflict.', u'id': u'afd34ce58d00ff9dd50c54807797ef7a', u'error': u'conflict'}]

What is the version of couchdb?

benoitc avatar Jun 06 '12 07:06 benoitc