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 function hasErrorLabel(string $errorLabel): bool
/* Méthodes héritées */
final public function Exception::getMessage(): string
final public function Exception::getPrevious(): ?Throwable
final public function Exception::getCode(): int
final public function Exception::getFile(): string
final public function Exception::getLine(): int
final public function Exception::getTrace(): array
final public function Exception::getTraceAsString(): string
public function Exception::__toString(): string
private function 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

User Contributed Notes

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