MongoDB\Driver\Exception\RuntimeException::hasErrorLabel
(mongodb >= 1.6.0)
MongoDB\Driver\Exception\RuntimeException::hasErrorLabel — Returns whether an error label is associated with an exception
Beschreibung
$errorLabel
): bool
Returns whether the errorLabel
has been set for this
exception. Error labels are set by either the server or the driver to
indicated specific situations on which you might want to decide on how you
want to handle a specific exception. A common situation might be to find
out whether you can safely retry a transaction that failed due to a
transient error (like a networking issue, or a transaction conflict).
Examples of error labels are TransientTransactionError
and UnknownTransactionCommitResult
.
Parameter-Liste
-
errorLabel
-
The name of the
errorLabel
to test for.
Rückgabewerte
Whether the given errorLabel
is associated with this
exception.
Siehe auch
- MongoDB\Driver\Session::commitTransaction() - Commits a transaction
- » MongoDB documentation on transactions