Exception classes

目次

The MongoDB\Driver\Exception\AuthenticationException class

はじめに

Thrown when the driver fails to authenticate with the server.

クラス概要

MongoDB\Driver\Exception\AuthenticationException
class MongoDB\Driver\Exception\AuthenticationException extends MongoDB\Driver\Exception\ConnectionException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\BulkWriteException class

はじめに

Thrown when a bulk write operation fails.

クラス概要

MongoDB\Driver\Exception\BulkWriteException
class MongoDB\Driver\Exception\BulkWriteException extends MongoDB\Driver\Exception\WriteException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected MongoDB\Driver\WriteResult $writeResult;
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public MongoDB\Driver\WriteResult MongoDB\Driver\Exception\WriteException::getWriteResult()
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\CommandException class

はじめに

Thrown when a command fails.

クラス概要

MongoDB\Driver\Exception\CommandException
class MongoDB\Driver\Exception\CommandException extends MongoDB\Driver\Exception\ServerException implements MongoDB\Driver\Exception\Exception {
/* プロパティ */
protected object $resultDocument;
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* メソッド */
final public object getResultDocument()
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

プロパティ

resultDocument

The result document associated with the failed command.

The MongoDB\Driver\Exception\ConnectionException class

はじめに

Base class for exceptions thrown when the driver fails to establish a database connection.

クラス概要

MongoDB\Driver\Exception\ConnectionException
class MongoDB\Driver\Exception\ConnectionException extends MongoDB\Driver\Exception\RuntimeException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\ConnectionTimeoutException class

はじめに

Thrown when the driver fails to establish a database connection within a specified time limit (connectTimeoutMS) or server selection fails (serverSelectionTimeoutMS).

クラス概要

MongoDB\Driver\Exception\ConnectionTimeoutException
final class MongoDB\Driver\Exception\ConnectionTimeoutException extends MongoDB\Driver\Exception\ConnectionException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\EncryptionException class

はじめに

Base class for exceptions thrown during client-side encryption.

クラス概要

MongoDB\Driver\Exception\EncryptionException
class MongoDB\Driver\Exception\EncryptionException extends MongoDB\Driver\Exception\RuntimeException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\Exception interface

はじめに

Common interface for all driver exceptions. This may be used to catch only exceptions originating from the driver itself.

クラス概要

MongoDB\Driver\Exception\Exception
class MongoDB\Driver\Exception\Exception {
}

The MongoDB\Driver\Exception\ExecutionTimeoutException class

はじめに

Thrown when a query or command fails to complete within a specified time limit (e.g. » maxTimeMS).

クラス概要

MongoDB\Driver\Exception\ExecutionTimeoutException
final class MongoDB\Driver\Exception\ExecutionTimeoutException extends MongoDB\Driver\Exception\ServerException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

変更履歴

バージョン 説明
PECL mongodb 1.5.0

This class now extends MongoDB\Driver\Exception\ServerException instead of MongoDB\Driver\Exception\RuntimeException.

The MongoDB\Driver\Exception\InvalidArgumentException class

はじめに

Thrown when a driver method is given invalid arguments (e.g. invalid option types).

クラス概要

MongoDB\Driver\Exception\InvalidArgumentException
class MongoDB\Driver\Exception\InvalidArgumentException extends InvalidArgumentException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\LogicException class

はじめに

Thrown when the driver is incorrectly used (e.g. rewinding a cursor).

クラス概要

MongoDB\Driver\Exception\LogicException
class MongoDB\Driver\Exception\LogicException extends LogicException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\RuntimeException class

はじめに

Thrown when the driver encounters a runtime error (e.g. internal error from » libmongoc).

クラス概要

MongoDB\Driver\Exception\RuntimeException
class MongoDB\Driver\Exception\RuntimeException extends RuntimeException implements MongoDB\Driver\Exception\Exception {
/* プロパティ */
protected arraynull $errorLabels;
/* 継承したプロパティ */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* メソッド */
final public bool hasErrorLabel(string $errorLabel)
/* 継承したメソッド */
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

プロパティ

errorLabels

Contains an array of error labels to go with an exception. For example, error labels can be used to detect whether a transaction can be retried safely if the TransientTransactionError label is present. The existence of a specific error label should be tested for with the MongoDB\Driver\Exception\RuntimeException::hasErrorLabel, instead of interpreting this errorLabels property manually.

変更履歴

バージョン 説明
PECL mongodb 1.6.0

The MongoDB\Driver\Exception\RuntimeException::hasErrorLabel method and MongoDB\Driver\Exception\RuntimeException::errorLabels property have been added.

The MongoDB\Driver\Exception\ServerException class

はじめに

Base class for exceptions thrown by the server. The code of this exception and its subclasses will correspond to the original error code from the server.

クラス概要

MongoDB\Driver\Exception\ServerException
class MongoDB\Driver\Exception\ServerException extends MongoDB\Driver\Exception\RuntimeException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\SSLConnectionException class (deprecated)

警告

This exception class is deprecated and may be removed in a future major version. The driver has never thrown this exception.

はじめに

Thrown when the driver fails to establish an SSL connection with the server.

クラス概要

MongoDB\Driver\Exception\SSLConnectionException
final class MongoDB\Driver\Exception\SSLConnectionException extends MongoDB\Driver\Exception\ConnectionException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\UnexpectedValueException class

はじめに

Thrown when the driver encounters an unexpected value (e.g. during BSON serialization or deserialization).

クラス概要

MongoDB\Driver\Exception\UnexpectedValueException
class MongoDB\Driver\Exception\UnexpectedValueException extends UnexpectedValueException implements MongoDB\Driver\Exception\Exception {
/* 継承したプロパティ */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

The MongoDB\Driver\Exception\WriteException class

はじめに

Base class for exceptions thrown by a failed write operation. The exception encapsulates a MongoDB\Driver\WriteResult object.

クラス概要

MongoDB\Driver\Exception\WriteException
abstract class MongoDB\Driver\Exception\WriteException extends MongoDB\Driver\Exception\ServerException implements MongoDB\Driver\Exception\Exception {
/* プロパティ */
protected MongoDB\Driver\WriteResult $writeResult;
/* 継承したプロパティ */
protected arraynull $errorLabels;
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* メソッド */
final public MongoDB\Driver\WriteResult getWriteResult()
/* 継承したメソッド */
final public bool MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel)
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()
}

プロパティ

writeResult

The MongoDB\Driver\WriteResult associated with the failed write operation.

変更履歴

バージョン 説明
PECL mongodb 1.5.0

This class now extends MongoDB\Driver\Exception\ServerException instead of MongoDB\Driver\Exception\RuntimeException.