collection.remove() may return null when it should return WriteResult or throw an exception

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.6.5
    • Component/s: API
    • None
    • Environment:
      Windows 7, MongoDB 1.8.2, Java Driver 2.6.5
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I'm experiencing <<null>> results when calling

      collection.remove(...)

      where the contract says that either a WriteResult is returned or an exception is thrown.

      I've tracked this down to DBTCPConnector#_checkWriteError that ends with

      WriteResult _checkWriteError( DB db , MyPort mp , DBPort port , WriteConcern concern )
      CommandResult e = null;
      e = port.runCommand( db , concern.getCommand() );
      if ( ! e.hasErr() )
      return new WriteResult( e , concern );
      e.throwOnError();
      return null;
      }

      if

      e.throwOnError();

      does not throw an exception ( ok() || !hasErr())

      return null;

      is returned.

            Assignee:
            Jeffrey Yemin
            Reporter:
            Christian pesch
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: