diff options
| author | Donald Lee <dlqs@gmx.com> | 2021-07-24 03:34:28 +0800 |
|---|---|---|
| committer | Donald Lee <dlqs@gmx.com> | 2021-07-24 03:40:57 +0800 |
| commit | 4093300ee891bd7559b93e2b7c94fb6fc68b5ddc (patch) | |
| tree | e9166cca8ccdc4d7603bb6d375cb91f9ee04bfb4 /lib/frrscript.c | |
| parent | 6d28552d2da20852a3580da17894d7b7db6756ba (diff) | |
lib: zlog err in error cases during lua loading
Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'lib/frrscript.c')
| -rw-r--r-- | lib/frrscript.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/frrscript.c b/lib/frrscript.c index 8fe8a93f05..59fce36c7a 100644 --- a/lib/frrscript.c +++ b/lib/frrscript.c @@ -317,11 +317,18 @@ int frrscript_load(struct frrscript *fs, const char *function_name, /* Push the Lua function we want */ lua_getglobal(L, function_name); - if (lua_isfunction(L, lua_gettop(L)) == 0) + if (lua_isfunction(L, lua_gettop(L)) == 0) { + zlog_err("frrscript: loaded script '%s.lua' but %s not found", + script_name, function_name); goto fail; + } - if (load_cb && (*load_cb)(fs) != 0) + if (load_cb && (*load_cb)(fs) != 0) { + zlog_err( + "frrscript: '%s.lua': %s: loaded but callback returned non-zero exit code", + script_name, function_name); goto fail; + } /* Add the Lua function state to frrscript */ struct lua_function_state key = {.name = function_name, .L = L}; |
