{"action":"opened","issue":{"url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/229","repository_url":"https://api.github.com/repos/mongodb/mongo-php-library","labels_url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/229/comments","events_url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/229/events","html_url":"https://github.com/mongodb/mongo-php-library/issues/229","id":171243554,"number":229,"title":"MongoDB\\Driver\\Exception\\BulkWriteException on insert not documented","user":{"login":"jacobweber","id":542988,"avatar_url":"https://avatars.githubusercontent.com/u/542988?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobweber","html_url":"https://github.com/jacobweber","followers_url":"https://api.github.com/users/jacobweber/followers","following_url":"https://api.github.com/users/jacobweber/following{/other_user}","gists_url":"https://api.github.com/users/jacobweber/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobweber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobweber/subscriptions","organizations_url":"https://api.github.com/users/jacobweber/orgs","repos_url":"https://api.github.com/users/jacobweber/repos","events_url":"https://api.github.com/users/jacobweber/events{/privacy}","received_events_url":"https://api.github.com/users/jacobweber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-15T19:32:09Z","updated_at":"2016-08-15T19:32:09Z","closed_at":null,"body":"If I have a collection with an indexed field, and I call insertOne to try to insert a duplicate value in that field, I get a BulkWriteException:\r\n\r\n```\r\nclass MongoDB\\Driver\\Exception\\BulkWriteException#197 (9) {\r\n  protected $message =>\r\n  string(126) \"insertDocument :: caused by :: 11000 E11000 duplicate key error index: STF.preferences.$sviUserId_1  dup key: { : \"00090A19\" }\"\r\n...\r\n```\r\n\r\nShouldn't this throw one of the exceptions from this library, or an InsertOneResult? The documentation doesn't say that this function can throw an exception."}}
{"actor":{"display_login":"jacobweber"}}