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 bool $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 ( void ) : string
final public Exception::getPrevious ( void ) : Throwable
final public Exception::getCode ( void ) : mixed
final public Exception::getFile ( void ) : string
final public Exception::getLine ( void ) : int
final public Exception::getTrace ( void ) : array
final public Exception::getTraceAsString ( void ) : string
public Exception::__toString ( void ) : string
final private Exception::__clone ( void ) : 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
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