Package com.mongodb

Class MongoOperationTimeoutException

All Implemented Interfaces:
Serializable

@Alpha(CLIENT) public final class MongoOperationTimeoutException extends MongoTimeoutException
Exception thrown to indicate that a MongoDB operation has exceeded the specified timeout for the full execution of operation.

The MongoOperationTimeoutException might provide information about the underlying cause of the timeout, if available. For example, if retries are attempted due to transient failures, and a timeout occurs in any of the attempts, the exception from one of the retries may be appended as the cause to this MongoOperationTimeoutException.

The key difference between MongoOperationTimeoutException and MongoExecutionTimeoutException lies in the nature of these exceptions. MongoExecutionTimeoutException indicates a server-side timeout capped by a user-specified number. These server errors are transformed into the new MongoOperationTimeoutException. On the other hand, MongoOperationExecutionException denotes a timeout during the execution of the entire operation.

Since:
5.2
See Also:
  • Constructor Details

    • MongoOperationTimeoutException

      public MongoOperationTimeoutException(String message)
      Construct a new instance.
      Parameters:
      message - the message
    • MongoOperationTimeoutException

      public MongoOperationTimeoutException(String message, Throwable cause)
      Construct a new instance
      Parameters:
      message - the message
      cause - the cause