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

Find collection example references nonexistent error field

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.24.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible

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

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

              Created:
              Updated:
              Resolved: