Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3387

getLastErrorDetailed does not report an error

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 1.8.1
    • Component/s: Internal Client
    • Labels:
      None
    • Environment:
      linux, ubuntu lucyd.
    • ALL

      Request:
      { "findAndModify" : "points", "query" :

      { "_id" : "b91bb726-fe07-5c37-92e7-56077fbc2b36", "version" : 0 }

      , "update" : { "$set" :

      { < SOME FIELDS HERE > }

      }, "new" : true, "upsert" : false }
      Result:

      { "errmsg" : "No matching object found", "ok" : 0 }

      As far as mongo C++ driver does not throw exceptions and every command has it's own way to report errors I prefer to use getLastErrorDetailed() where possible. But unfortunately it reports that there was no error:

      { "n" : 0, "connectionId" : 88, "err" : null, "ok" : 1 }

      Please, make C++ driver to report error is only one way. It would especially good if it would be exceptions. I'm really frustrated to find out that one part of my application has crashed with very strange error because there is another one way to report error which my magic checker does not know about.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kibergus Alexey Guseynov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: