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.

参见

相关文章
php mongodb driver exception the mongodb driver exception executiontimeoutexception classphp mongodb driver exception the mongodb driver exception invalidargumentexception classphp mongodb driver exception the mongodb driver exception runtimeexception classphp mongodb driver cursor returns the server associated with this cursorphp mongodb driver monitoring commandfailedevent returns the exception associated with the failed commandphp mongodb driver monitoring commandfailedevent returns the command s operation idphp mongodb driver monitoring commandsucceededevent returns the command s operation idphp mongodb driver monitoring commandsucceededevent returns the command reply documentphp mongodb driver exception runtimeexception returns whether an error label is associated with an exceptionphp mongodb driver writeconcern returns an object for bson serializationphp mongodb driver writeconcernerror returns the writeconcernerror s error codephp mongodb driver writeconcernerror returns the writeconcernerror s error messagephp mongodb driver writeerror returns the writeerror s error codephp mongodb driver writeerror returns the writeerror s error messagephp mongodb driver exception writeexception returns the writeresult for the failed write operationphp mongodb driver writeresult returns the number of documents inserted excluding upserts php mongodb driver writeresult returns the number of documents selected for updatephp mongodb driver writeresult returns the server associated with this write resultphp mongodb driver writeresult returns any write concern error that occurredphp mongodb driver writeresult returns whether the write was acknowledged
关注编程学问公众号