Exceptions not being honored during Update [Fixed] #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upon update, errors such as unique index violations are not being
propagated to client code. With Mongo in verbose mode, the exceptions
are indeed occurring on the server side, and the update is failing,
but the failure mode just isn't being reported by NoRM and the update
itself is failing.
Errors are propagated correctly upon insert. Reading through
MongoCollectionGeneric.cs, in the Insert method, the following block
of code is executed immediately after the insert is made:
if (_connection.StrictMode)
{
var error = _db.LastError();
if (error.Code > 0)
{
throw new MongoException(error.Error);
}
}
Yet this block is not found after the update is made via the Update
method of the same class. I wonder if there's a reason for this or
simply an oversight? Thanks!
Stephen