The isRetryableConflict() function is the default predicate used by .retry() to decide whether a failed query should be retried. SurrealDB does not currently expose a structured retryable error kind, so the predicate matches on the error message.
Import:
Source: utils/index.ts
Function signature
Parameters
| Parameter | Type | Description |
|---|---|---|
error | Error | The error thrown by a failed query. |
Returns
boolean - true if the error looks like a retryable write conflict (its message contains "conflict" or "can be retried"), false otherwise
Overriding the default predicate
Pass a custom retryable function in RetryOptions to change what counts as retryable, optionally reusing isRetryableConflict as a base:
Note
See also
Query.retry() - Retry queries on write conflict
RetryOptions - Retry configuration type
Error handling - Handling SDK errors