Relates to: PR #441 ("add error tracking and retry methods to query collection utils")
Scope: Documentation / DX
Breaking changes: None (documenting existing behavior)
Summary#
QueryCollection.utils.clearError() can throw errors when the refetch fails, but this behavior is not documented. Users need clear guidance on proper error handling patterns.
Current Implementation#
clearError: () => {
lastError = undefined
errorCount = 0
lastErrorUpdatedAt = 0
return refetch({ throwOnError: true })
}
The method does throw on refetch failure, but this isn't documented anywhere.
Proposed Documentation#
Add to error handling guide and JSDoc:
clearError: () => Promise<void>
Acceptance Criteria#
Additional Context#
This is especially important when combined with the exact refetch targeting (#537), as disabled/unobserved queries may behave differently.
Closing as obsolete: #2168 removed query-db's
utils.clearError()(along withlastError,isError, anderrorCount). Failures now show incollection.health(failureReasonwhile the Query retries,erroronce it stops), andcollection.reload()is the retry. The migration table in the #2168 changeset lists the replacements.