MongoDB\Driver\Exception\RuntimeException::hasErrorLabel

Returns whether an error label is associated with an exception

&reftitle.description; final public `bool` `MongoDB\Driver\Exception\RuntimeException::hasErrorLabel` `string` `errorLabel`

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`.

&reftitle.parameters;

`errorLabel`

- The name of the `errorLabel` to test for.

&reftitle.returnvalues;

Whether the given `errorLabel` is associated with this exception.

&reftitle.seealso;

- `MongoDB\Driver\Session::commitTransaction`
- MongoDB documentation on transactions