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

getLastErrorDetailed does not report an error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Works as Designed
    • Affects Version/s: 1.8.1
    • Fix Version/s: None
    • Component/s: Internal Client
    • Labels:
      None
    • Environment:
      linux, ubuntu lucyd.
    • Operating System:
      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

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

              Dates

              Created:
              Updated:
              Resolved: