MongoDriverException¶
class MongoDriverException(
message: String,
response: BsonDocument?,
request: BsonDocument?,
server: MongoException.ServerAddress?,
command: Command,
namespace: String,
cause: Throwable? = null
) : MongoException
Generic exception thrown when the driver has a problem.
Constructors¶
MongoDriverException¶
constructor(
message: String,
response: BsonDocument?,
request: BsonDocument?,
server: MongoException.ServerAddress?,
command: Command,
namespace: String,
cause: Throwable? = null
)
Properties¶
cause¶
command¶
The command that was being executed when this exception occurred, from the point of view of KtMongo.
The various drivers have preprocessing steps that modify the command before it is sent, so this field may not exactly contain what the database received.
For example, the option readPreference is never sent to the database, as it specifies which replica the driver should send the message to.
To see the exact command sent to the database, see request, if present.
message¶
namespace¶
The database or collection that was being accessed when this exception occurred.
request¶
val request: BsonDocument?
If this exception corresponds to the sending of a database request, this field contains that request.
Note that the official drivers do not provide easy access to the exact request that was sent, so this field may often be null when using it.
response¶
val response: BsonDocument?
If this exception corresponds to the processing of a database response, this field contains that response.
server¶
The address of the server that was being contacted when this exception occurred.
When connected to a replica set, this contains the specific replica set member that lead to this exception.