dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
24.46k stars 884 forks source link

Report which undeclared key scripts attempted to access #3212

Closed chakaz closed 1 hour ago

chakaz commented 6 days ago

Today, when a Lua script tries to access an undeclared key we just return an error such as:

Error running script (call to <hash>): @user_script:248: script tried accessing undeclared key

To make debugging easier, we should print which key was attempted to access. This could help, for example, when the key is missing hashtags, etc

Note to future self: CheckKeysDeclared should likely return the key at hand if indeed it fails.