Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-4853

[Server] WriteResult.writeError may have errInfo field

      Per the Write Command Specification:

      errInfo: Optional field, with a BSONObj format. This field contains structured information about an error that can be processed programmatically. For example, if a request returns with a shard version error, we may report the proper shard version as a sub-field here.

      In the WriteResult documentation, we only discuss an errInfo field on WriteResult.writeConcernError. I think it may need to go on WriteResult.writeError as well (since the spec mentions it could occur with sharding).

      On that note, I have no idea what the sharding error might be. It'd be helpful to have a kernel engineer confirm for us before we document it. Additionally, knowing how to trigger such an error would be helpful for driver authors implementing the CRUD API spec, which has guidelines for error handling.

            Assignee:
            joseph.dougherty@mongodb.com Joseph Dougherty
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 28 weeks, 3 days ago