Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2256

Improve error message prefix for bulk write document validation errors

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • 1.9.0
    • 1.7.0
    • libmongoc
    • None

    Description

      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()

      Attachments

        Activity

          People

            jesse@mongodb.com A. Jesse Jiryu Davis
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: