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

classMongoDB\Driver\Exception\RuntimeExceptionextendsRuntimeExceptionimplementsMongoDB\Driver\Exception\Exception {
protectedstring$message = "";
privatestring$string = "";
protectedint$code;
protectedstring$file = "";
protectedint$line;
privatearray$trace = [];
private?Throwable$previous = null;
finalpublichasErrorLabel(string$errorLabel): bool
finalpublicException::getCode(): int
finalpublicException::getLine(): int
}

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

VersionDescription
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

To Top