There is code in bulk_api.js to set Error.prototype in BulkWriteError instances' prototype chain.
BulkWriteError.prototype = new Error(); BulkWriteError.prototype.constructor = BulkWriteError;
We should do the similar logic for WriteError and WriteConcernError so that the underlying WriteError of a BulkWriteError can be rethrown and still have a stack trace.