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
```
This commit is contained in:
Madelyn Olson
2022-04-14 01:18:32 -07:00
committed by GitHub
parent 95050f2683
commit effa707e9d
13 changed files with 46 additions and 46 deletions

View File

@@ -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"