Clients check one of three codes to identify unique index constraint violations. None are the current value of ErrorCodes::DuplicateKey, which Write commands return in this scenario. Rather than make all drivers check a 4th code, we might as well assign DuplicateKey an existing one, such as 11, 000. Pending validation that the write commands send DuplicateKey.
Proposal: Rename the existing DuplicateKey to OBSOLETE_DuplicateKey, and assign DuplicateKey <- 11000 in error_codes.err. So long as no existing code looks for the current value of DuplicateKey on the wire, it is safe to change the value used to represent DuplicateKey in error_codes.err. The server code does not, and behackett says the drivers don't, either.