Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1550

Error::Parser fails to correctly handle writeErrors

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.0.rc0, 2.6.4
    • Affects Version/s: 2.6.2
    • Component/s: None
    • None
    • Environment:
      Debian Jessie / macOS Mojave

      Insertion of a document with a duplicate key returns a WriteResult such as:

      {WriteResult({ "nInserted" : 0, "writeError" : { "code" : 11000, "errmsg" : "E11000 duplicate key error collection: aragorn_development.foo index: id dup key: { : ObjectId('5bda11fdf3b189195ebb0f3a') }" }}

       

      The Error::Parser#122 (parse_code) handles nested error codes for write concern errors, but not writeErrors. The resulting OperationFailure lacks a numeric error code (e.g., 11000).

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            brendandixon Brendan Dixon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: