Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2381

Remove handling of "raw" field in command errors

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      While investigating PYTHON-2342 I noticed that pymongo inspects command errors for the "raw" field: https://github.com/mongodb/mongo-python-driver/blob/956ce3d4b0edfa9c1d946109db743f82ed0bfc0a/pymongo/helpers.py#L123-L130

              # Mongos returns the error details in a 'raw' object
              # for some errors.
              if "raw" in response:
                  for shard in itervalues(response["raw"]):
                      # Grab the first non-empty raw error from a shard.
                      if shard.get("errmsg") and not shard.get("ok"):
                          details = shard
                          break
      

      I think this code only exists for legacy versions of MongoDB that are no longer supported. We should confirm this and remove this code. The original code was added in PYTHON-374 and updated in PYTHON-766.

            Assignee:
            Unassigned Unassigned
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: