Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Package com.mongodb

Class MongoCommandException

    • Constructor Detail

      • MongoCommandException

        public MongoCommandException​(BsonDocument response,
                                     ServerAddress address)
        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​()
        Gets the error code associated with the command failure.
        Returns:
        the error code
      • getErrorMessage

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

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