The WCErrorDetail class currently resides under the sharding write commands library, yet it is used in non-sharding context, which requires sharding-specific code to be pulled as part of library dependencies.
It should instead be moved under mongo/rpc.