Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1679

bulk_write class and error handling (error category mismatch?)

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • 3.4.0
    • None

    Description

      Using mongocxx::bulk_write::append() with a document that fails internal validation (e.g. using $ in field names) throws a mongocxx::logic_error exception.

      This exception, however, belongs to the server_error_category, which seems weird since it is a client (driver) generated error in libmongoc.

      How are users supposed to differentiate std::system_error exceptions if they want to know if the error originated in the server or client? Also, not exposing the libmongoc error domain (e.g. as std::error_condition) makes it really hard to take actions depending on the type of the error.

      How are clients of mongo-cxx-driver code supposed to handle this?

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            saszel Sascha Zelzer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: