Package com.mongodb

Class MongoQueryException

    • Constructor Detail

      • MongoQueryException

        public MongoQueryException​(ServerAddress address,
                                   int errorCode,
                                   String errorMessage)
        Construct an instance.
        Parameters:
        address - the server address
        errorCode - the error code
        errorMessage - the error message
      • MongoQueryException

        public MongoQueryException​(MongoCommandException commandException)
        Construct an instance from a command exception.
        Parameters:
        commandException - the command exception
        Since:
        3.7
    • Method Detail

      • getErrorCode

        public int getErrorCode​()
        Gets the error code for this query failure.
        Returns:
        the error code
      • getErrorMessage

        public String getErrorMessage​()
        Gets the error message for this query failure.
        Returns:
        the error message