PRECONDITION_FAILED
If-Match did not match: the record changed after you read it, so the update was not applied.
Typical cause
Two writers changed the same record: someone edited it in the app, or another job updated it, between your GET and your PATCH.
Fix
Read the record again (GET, which returns the current ETag), reapply your change, and send it with the new If-Match.
Where it comes from
Any operation can answer it (HTTP 412).
Related
{
"error": {
"code": "PRECONDITION_FAILED",
"message": "…",
"request_id": "req_01JB4Z0K3Q7V8W9X0Y1Z2A3B4C",
"doc_url": "https://developers.tracken.ee/errors/PRECONDITION_FAILED"
}
}code, never on message, which is developer-facing English and may change. Field problems are in details, each with a JSON Pointer; the figures for your own text are in context. Quote request_id when you contact support.tracken accounts update …
# exits 8 and prints the code, the message, each field problem and the request idimport { isApiError } from "@tracken/sdk";
try {
await tracken.accounts.update(…);
} catch (error) {
if (!isApiError(error, "PRECONDITION_FAILED")) throw error;
// Read the record again (GET, which returns the current ETag), reapply your change, and send it with the new If-Match.
}