PHP Conference Japan 2024

MongoDB\Driver\Exception\RuntimeException::hasErrorLabel

(mongodb >= 1.6.0)

MongoDB\Driver\Exception\RuntimeException::hasErrorLabel傳回例外是否與錯誤標籤關聯

說明

final public MongoDB\Driver\Exception\RuntimeException::hasErrorLabel(字串 $errorLabel): 布林值

回傳此例外是否已設定 errorLabel。錯誤標籤由伺服器或擴充功能設定,用於指示應用程式可以處理的特定情況。一種常見的情況是判斷是否安全地重試因暫時性錯誤(例如網路錯誤、交易衝突)而失敗的交易。錯誤標籤的範例包括 TransientTransactionErrorUnknownTransactionCommitResult

參數

errorLabel

要測試的 errorLabel 名稱。

回傳值

指定的 errorLabel 是否與此例外相關聯。

新增註釋

使用者貢獻的註釋

此頁面沒有使用者貢獻的註釋。
To Top