Package com.mongodb

Class MongoCommandException

    • Constructor Detail

      • MongoCommandException

        public MongoCommandException​(BsonDocument response,
                                     ServerAddress address)
        Deprecated.
        Construct a new instance with the CommandResult from a failed command
        Parameters:
        response - the command response
        address - the address of the server that generated the response
    • Method Detail

      • getErrorCode

        public int getErrorCode()
        Deprecated.
        Gets the error code associated with the command failure.
        Returns:
        the error code
      • getErrorCodeName

        public java.lang.String getErrorCodeName()
        Deprecated.
        Gets the name associated with the error code.
        Returns:
        the error code name, which may be the empty string
        Since:
        3.8
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Deprecated.
        Gets the error message associated with the command failure.
        Returns:
        the error message
      • getResponse

        public BsonDocument getResponse()
        Deprecated.
        For internal use only.
        Returns:
        the full response to the command failure.