Skip to content

Commit

Permalink
return results on bulk_save and add them to the excception in case of
Browse files Browse the repository at this point in the history
conflicts.
  • Loading branch information
benoitc committed Dec 3, 2010
1 parent f57a75a commit 386f765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion couchdbkit/client.py
Expand Up @@ -512,7 +512,8 @@ def is_id(doc):
'_rev': res['rev']
})
if errors:
raise BulkSaveError(errors)
raise BulkSaveError(errors, results)
return results
bulk_save = save_docs

def delete_docs(self, docs, all_or_nothing=False):
Expand Down
3 changes: 2 additions & 1 deletion couchdbkit/exceptions.py
Expand Up @@ -37,8 +37,9 @@ class BulkSaveError(Exception):
""" exception raised when bulk save contain errors.
error are saved in `errors` property.
"""
def __init__(self, errors, *args):
def __init__(self, errors, results, *args):
self.errors = errors
self.results = results

class ViewServerError(Exception):
""" exception raised by view server"""
Expand Down

0 comments on commit 386f765

Please sign in to comment.