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

Improve function "const T* mongo::Status::extraInfo()" to support errors with optional extraInfo

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Execution 2021-05-03

      Improve template function "const T* mongo::Status::extraInfo()" to support errors with optional extra info by changing its contract to return nullptr when status is not OK, the error type matches parameter T, the error permits optional extra info and extra info is not present. Currently, the behaviour of the function for the given conditions is to trip an assertion.

      This change would simplify caller's access to extraInfo when dealing with errors with optional extra info. Currently, to retrieve the extraInfo it is necessary to check the error code of the status and if the extraInfo exists.

            Assignee:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Reporter:
            mindaugas.malinauskas@mongodb.com Mindaugas Malinauskas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: