The error message
The write and the consumer guards on the failed row
ReadonlycodeWidened to every subclass's code, so a subclass can narrow it. An instance
of this class itself always carries "ConditionalCheckFailedError", and a
WriteConditionFailedError carries "WriteConditionFailedError".
Comparing code and testing instanceof work for either class; only code
that assigns code to a variable typed as the single literal
"ConditionalCheckFailedError" needs to widen that variable.
ReadonlyentityThe name of the entity being written, or of the join table for a join
table's create or delete
ReadonlyguardsEvery consumer guard on the row whose check failed
ReadonlyidThe id of the entity being written. For a join table, its keys, such as
customerId=customer-1, storeId=store-1
Error thrown, inside a TransactionWriteFailedError, when a consumer's write condition does not hold and the write is not made.
DynamoDB reports only that a row's combined check failed, so when more than one consumer guard landed on that row, every one of them is named.
A row that does not exist, a failed referential-integrity check, a relationship that changed concurrently, or a HasMany or HasAndBelongsToMany id that is not related is reported as a plain ConditionalCheckFailedError instead, never as this error. A guard whose target cannot be found in what is stored, such as a BelongsTo whose foreign key is
null, is reported as this error before anything is sent.Its message names the write and the guards, for example
ConditionalCheckFailed: Write condition failed on Order with ID 'order-1': its own row.Example