RX0050

Domain: Execution

Error message

data.update[%s, …] refused: the key %s does not exist — update never creates; use data.add

In the message, %s marks a value that the engine fills in when it raises the error.

The story

This is the mirror image of the add refusal. You asked data update to change an item, but there is no such key. Update only overwrites what already exists. It never creates. That is the guard that keeps typos from quietly turning into new entries. If you misspell a key, you want to hear about it, not to find out later that you have a second, unwanted item. There are also two cases where there is no key to update by at all. If you hand update a value without a label, it has no key to aim at. And if the collection is a plain list, it has no keys, so there is nothing to name. The second part of the message tells you which of these situations you are in. Here is the fix. If you meant to create the item, use data add. If you meant to change an existing one, double check the key spelling against what the collection really holds. And if it is a list, update it a different way. Update changes. Add creates. Keep them straight and your data stays tidy.

Text from the Rush engine's error catalogue.