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

Find collection example references nonexistent error field

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Unknown Unknown
    • 1.24.0
    • None
    • None
    • Fully Compatible

    Description

      In https://mongoc.org/libmongoc/current/mongoc_database_find_collections_with_opts.html

         if (mongoc_cursor_error (cursor, &error))
            fprintf (stderr, "%s\n", error.msg);
         }
      

      Produces

      main.c:139:37: error: 'bson_error_t' {aka 'struct _bson_error_t'} has no member named 'msg'
        139 |       fprintf (stderr, "%s\n", error.msg);
            |                                     ^
      

      Looking at definition in source, the field is called message:

      typedef struct _bson_error_t {
         uint32_t domain;
         uint32_t code;
         char message[BSON_ERROR_BUFFER_SIZE];
      } bson_error_t BSON_ALIGNED_END (8);
      

      Attachments

        Activity

          People

            gil.alon@mongodb.com Gil Alon
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: