Package com.mongodb

Class MongoServerException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MongoBulkWriteException, MongoCommandException, MongoQueryException, MongoWriteConcernException, MongoWriteException, WriteConcernException

public abstract class MongoServerException extends MongoException
An exception indicating that some error has been raised by a MongoDB server in response to an operation.
Since:
2.13
  • Constructor Details

    • MongoServerException

      public MongoServerException(String message, ServerAddress serverAddress)
      Construct a new instance.
      Parameters:
      message - the message from the server
      serverAddress - the address of the server
    • MongoServerException

      public MongoServerException(int code, String message, ServerAddress serverAddress)
      Construct a new instance.
      Parameters:
      code - the error code from the server
      message - the message from the server
      serverAddress - the address of the server
  • Method Details

    • getServerAddress

      public ServerAddress getServerAddress()
      Gets the address of the server.
      Returns:
      the address