php8.5
Home/ Manual/ reference / mongodb/ Exception classes

Exception classes

The class hierarchy for MongoDB exceptions is modeled after that of the SPL Exceptions. Base classes extend their SPL counterpart and all exception classes in the extension implement the MongoDB\Driver\Exception\Exception interface.

Authenticationexception Bulkwriteexception Bulkwritecommandexception Commandexception Connectionexception Connectiontimeoutexception Encryptionexception Exception Executiontimeoutexception Invalidargumentexception Logicexception Runtimeexception Serverexception Sslconnectionexception Unexpectedvalueexception Writeexception

The class hierarchy for MongoDB exceptions is modeled after that of the SPL Exceptions. Base classes extend their SPL counterpart and all exception classes in the extension implement the MongoDB\Driver\Exception\Exception interface.

  • MongoDB\Driver\Exception\LogicException (extends LogicException)
  • MongoDB\Driver\Exception\InvalidArgumentException (extends InvalidArgumentException)
  • MongoDB\Driver\Exception\UnexpectedValueException (extends UnexpectedValueException)
  • MongoDB\Driver\Exception\RuntimeException (extends RuntimeException)

    • MongoDB\Driver\Exception\ConnectionException

      • MongoDB\Driver\Exception\AuthenticationException
      • MongoDB\Driver\Exception\ConnectionTimeoutException
      • MongoDB\Driver\Exception\SSLConnectionException (deprecated)
    • MongoDB\Driver\Exception\EncryptionException
    • MongoDB\Driver\Exception\ServerException

      • MongoDB\Driver\Exception\BulkWriteCommandException
      • MongoDB\Driver\Exception\CommandException
      • MongoDB\Driver\Exception\ExecutionTimeoutException
      • MongoDB\Driver\Exception\WriteException (deprecated)

        • MongoDB\Driver\Exception\BulkWriteException

Source: reference/mongodb/exceptions.xml · from the official PHP manual (php/doc-en)