La classe MongoDB\Driver\Exception\RuntimeException

(mongodb >= 1.0.0)

Introduction

Levée lorsque le pilote rencontre une erreur d'exécution (par exemple, erreur interne de » libmongoc).

Synopsis de la classe

class MongoDB\Driver\Exception\RuntimeException extends RuntimeException implements MongoDB\Driver\Exception\Exception {
/* Propriétés */
protected ?array $errorLabels;
/* Propriétés héritées */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private ?Throwable $previous = null;
/* Méthodes */
final public hasErrorLabel(string $errorLabel): bool
/* Méthodes héritées */
final public Exception::getMessage(): string
final public Exception::getCode(): int
final public Exception::getFile(): string
final public Exception::getLine(): int
final public Exception::getTrace(): array
final public Exception::getTraceAsString(): string
public Exception::__toString(): string
private Exception::__clone(): void
}

Propriétés

errorLabels

Contient un tableau d'étiquettes d'erreur à parcourir avec une exception. Par exemple, les étiquettes d'erreur peuvent être utilisées pour détecter si une transaction peut être réessayée en toute sécurité si l'étiquette TransientTransactionError est présente. L'existence d'une étiquette d'erreur spécifique doit être testée avec MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(), au lieu d'interpréter manuellement la propriété errorLabels.

Historique

Version Description
PECL mongodb 1.6.0

La méthode MongoDB\Driver\Exception\RuntimeException::hasErrorLabel() et la propriété MongoDB\Driver\Exception\RuntimeException::errorLabels ont été ajoutées.

Sommaire