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

getLastErrorDetailed does not report an error

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • None
    • 1.8.1
    • Internal Client
    • None
    • linux, ubuntu lucyd.
    • ALL

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: