略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MongoDB\Driver\Exception\RuntimeException::hasErrorLabel

2024-11-15

MongoDB\Driver\Exception\RuntimeException::hasErrorLabel

(mongodb >= 1.6.0)

MongoDB\Driver\Exception\RuntimeException::hasErrorLabelReturns whether an error label is associated with an exception

说明

final public 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 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.

参数

errorLabel

The name of the errorLabel to test for.

返回值

Whether the given errorLabel is associated with this exception.

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mongodb-driver-runtimeexception.haserrorlabel.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3