Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19741

WriteError and WriteConcernError are not Error instances

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 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

      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 Waley Chen
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: