WriteError and WriteConcernError are not Error instances

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • 3.3.11
    • Affects Version/s: 3.1.6
    • Component/s: Shell
    • None
    • Fully Compatible
    • Build B (10/30/15), Build C (11/20/15), Platforms 2016-08-26
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Waley Chen (Inactive)
            Reporter:
            Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: