-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.0
-
Component/s: None
It appears that MongoCollection<TDocument>.InsertOneAsync throws a MongoWriteException which does not have any direct information about the kind of error happened, including non-unique key constraint violation. I checked the source and even single inserts are done via bulk write operations, which are inherently not very good at passing single-request error information. I was expecting MongoDuplicateKeyException to be thrown in case of such violation.
Is this going to change, or should we ignore the existence of MongoDuplicateKeyException and try to interrogate inner exceptions which seems very unwieldy?
- is duplicated by
-
CSHARP-1390 InsertOneAsync doesn't throw MongoDuplicateKeyException
- Closed