aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-07 09:44:45 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-07 09:44:45 +0100
commitd2f9feaf547b6fd3e7dc2a541b8e6b11282ef671 (patch)
tree08c8fa99463d99a0ffdd9ec51ee812a8752e3875
parentb2b65afe0f2e067c71584161a0f6b5ef9412cbaf (diff)
downloadrspamd-d2f9feaf547b6fd3e7dc2a541b8e6b11282ef671.tar.gz
rspamd-d2f9feaf547b6fd3e7dc2a541b8e6b11282ef671.zip
[Minor] Lua_redis: Report script registration position on errors
-rw-r--r--lualib/lua_redis.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index ae5fa2299..656bd6baa 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -1101,8 +1101,8 @@ local function load_script_task(script, task)
opt.task = task
opt.callback = function(err, data)
if err then
- logger.errx(task, 'cannot upload script to %s: %s',
- opt.upstream:get_addr(), err)
+ logger.errx(task, 'cannot upload script to %s: %s; registered from: %s:%s',
+ opt.upstream:get_addr(), err, script.caller.short_src, script.caller.currentline)
opt.upstream:fail()
script.fatal_error = err
else
@@ -1143,8 +1143,8 @@ local function load_script_taskless(script, cfg, ev_base)
opt.ev_base = ev_base
opt.callback = function(err, data)
if err then
- logger.errx(cfg, 'cannot upload script to %s: %s',
- opt.upstream:get_addr(), err)
+ logger.errx(cfg, 'cannot upload script to %s: %s; registered from: %s:%s',
+ opt.upstream:get_addr(), err, script.caller.short_src, script.caller.currentline)
opt.upstream:fail()
script.fatal_error = err
else
@@ -1183,7 +1183,10 @@ local function load_redis_script(script, cfg, ev_base, _)
end
local function add_redis_script(script, redis_params)
+ local caller = debug.getinfo(2)
+
local new_script = {
+ caller = caller,
loaded = false,
redis_params = redis_params,
script = script,