Improve error message prefix for bulk write document validation errors

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • 1.9.0
    • Affects Version/s: 1.7.0
    • Component/s: libmongoc
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      While reviewing CDRIVER-2250, I noticed that the following error message was used when inserting a document that contained a null byte in its string value:

      document to insert contains invalid key: invalid utf8 string for key "x"

      The first part of this message reads as if the key itself is invalid, when it is actually the value. In the past, most validation errors were due to keys (e.g. $ or dot characters), which might explain the original phrasing.

      I believe the following functions are affected:

      • _mongoc_validate_new_document()
      • _mongoc_validate_replace()
      • _mongoc_validate_update()

              Assignee:
              A. Jesse Jiryu Davis
              Reporter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: