mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-12 03:22:41 +00:00
Push formatter on lua stack only if does not throw exceptions
This commit is contained in:
parent
3840622984
commit
ea97325708
@ -49,14 +49,13 @@ int falco_formats::formatter(lua_State *ls)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
formatter = new sinsp_evt_formatter(s_inspector, format);
|
formatter = new sinsp_evt_formatter(s_inspector, format);
|
||||||
|
lua_pushlightuserdata(ls, formatter);
|
||||||
}
|
}
|
||||||
catch(sinsp_exception& e)
|
catch(sinsp_exception& e)
|
||||||
{
|
{
|
||||||
luaL_error(ls, "Invalid output format '%s': '%s'", format.c_str(), e.what());
|
luaL_error(ls, "Invalid output format '%s': '%s'", format.c_str(), e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_pushlightuserdata(ls, formatter);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user