Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions not being honored during Update [Fixed] #39

Closed
wants to merge 1 commit into from

Conversation

burnstek
Copy link

@burnstek burnstek commented Oct 5, 2010

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

@atheken
Copy link
Owner

atheken commented Oct 6, 2010

Thanks Stephen, I will merge this in to my repo.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants