summaryrefslogtreecommitdiff
path: root/src/function_lua.c
diff options
context:
space:
mode:
authorMadelyn Olson <34459052+madolson@users.noreply.github.com>2022-04-14 01:18:32 -0700
committerGitHub <noreply@github.com>2022-04-14 11:18:32 +0300
commiteffa707e9db3e9d00fff06d45e2a5a81d3d55fa9 (patch)
treeeb2214698dd05230bbb81337a26bba094de82a81 /src/function_lua.c
parent95050f2683173e2bb8b05b297e44809cd09316c6 (diff)
downloadredis-effa707e9db3e9d00fff06d45e2a5a81d3d55fa9.tar.gz
Fix incorrect error code for eval scripts and fix test error checking (#10575)
By the convention of errors, there is supposed to be a space between the code and the name. While looking at some lua stuff I noticed that interpreter errors were not adding the space, so some clients will try to map the detailed error message into the error. We have tests that hit this condition, but they were just checking that the string "starts" with ERR. I updated some other tests with similar incorrect string checking. This isn't complete though, as there are other ways we check for ERR I didn't fix. Produces some fun output like: ``` # Errorstats errorstat_ERR:count=1 errorstat_ERRuser_script_1_:count=1 ```
Diffstat (limited to 'src/function_lua.c')
-rw-r--r--src/function_lua.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/function_lua.c b/src/function_lua.c
index 8f21a1721..1e6363fd4 100644
--- a/src/function_lua.c
+++ b/src/function_lua.c
@@ -479,7 +479,7 @@ int luaEngineInitEngine() {
" i = dbg.getinfo(3,'nSl')\n"
" end\n"
" if type(err) ~= 'table' then\n"
- " err = {err='ERR' .. tostring(err)}"
+ " err = {err='ERR ' .. tostring(err)}"
" end"
" if i then\n"
" err['source'] = i.source\n"