Details
Description
BulkWriteError and WriteCommandError called captureStackTrace under v8, which provided a more detailed stack trace than the native one we get by inheriting from Error.
In particular, captureStackTrace():
- actually generates a stack from our error constructors, rather than using an out of date one from assignment of the BulkWriteError.prototype
- adds the stringification of the custom error type to the .stack property