mongodb/mongo-php-driver — pull request #186 by bjori (2012-09-25 00:49:14+00:00)
Title: Fixed PHP-493 (raise errors on failure)

I don't like the idea that the end user is exposed to the internal structure of the result document.
We should be detecting errors and displaying the appropriate errormessages instead on failure.

This patch fixes PHP-493 by checking the ok field and populating an error with the errormessage from the server, in case of errors.

The return value hasn't change, the user gets just the 'result' embedded document.