Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<MongoDB\Driver\Exception\RuntimeExceptionMongoDB\Driver\Exception\ServerException>
^MongoDB\Driver\Exception\RuntimeExceptionLast updated: Mon, 26 Oct 2026

MongoDB\Driver\Exception\RuntimeException::hasErrorLabel

(mongodb >= 1.6.0)

MongoDB\Driver\Exception\RuntimeException::hasErrorLabel — Returns whether an error label is associated with an exception

Description

final public function MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(string $errorLabel): bool

Returns whether the errorLabel has been set for this exception. Error labels are set by either the server or the extension to indicate specific situations that may be handled by an application. A common situation might be determining whether to safely retry a transaction that failed due to a transient error (e.g. network error, transaction conflict). Examples of error labels are TransientTransactionError and UnknownTransactionCommitResult.

Parameters

errorLabel

The name of the errorLabel to test for.

Return Values

Whether the given errorLabel is associated with this exception.


<MongoDB\Driver\Exception\RuntimeExceptionMongoDB\Driver\Exception\ServerException>
^MongoDB\Driver\Exception\RuntimeExceptionLast updated: Mon, 26 Oct 2026