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

MongoDB\Driver\Exception\RuntimeException extends RuntimeException implements MongoDB\Driver\Exception\Exception {
/* Propriétés */
protected array|null $errorLabels;
/* Propriétés héritées */
protected string $message;
protected int $code;
protected string $file;
protected int $line;
/* Méthodes */
final public hasErrorLabel(string $errorLabel): bool
/* Méthodes héritées */
final public Exception::getMessage(): string
final public Exception::getPrevious(): Throwable|null
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
final 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

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top