(mongodb >= 1.0.0)
當驅動程式遇到執行階段錯誤時拋出(例如來自 » libmongoc 的內部錯誤)。
包含一個與異常搭配的錯誤標籤陣列。例如,如果存在 TransientTransactionError
標籤,則可以使用錯誤標籤來檢測事務是否可以安全地重試。應該使用 MongoDB\Driver\Exception\RuntimeException::hasErrorLabel() 方法來測試特定錯誤標籤是否存在,而不是手動解讀 errorLabels
屬性。
版本 | 說明 |
---|---|
PECL mongodb 1.6.0 |
新增了 MongoDB\Driver\Exception\RuntimeException::hasErrorLabel() 方法和 MongoDB\Driver\Exception\RuntimeException::errorLabels 屬性。 |