mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-03 23:55:06 +00:00
Return lua errors not falco_exceptions
In C functions that implement lua functions, don't directly throw falco_exceptions, which results in opaque error messages like: Mon Feb 27 10:09:58 2017: Runtime error: Error invoking function output: C++ exception. Exiting. Instead, return lua errors via lua_error().
This commit is contained in:
@@ -81,7 +81,8 @@ int falco_formats::format_event (lua_State *ls)
|
||||
!lua_isstring(ls, -2) ||
|
||||
!lua_isstring(ls, -3) ||
|
||||
!lua_islightuserdata(ls, -4)) {
|
||||
throw falco_exception("Invalid arguments passed to format_event()\n");
|
||||
lua_pushstring(ls, "Invalid arguments passed to format_event()");
|
||||
lua_error(ls);
|
||||
}
|
||||
sinsp_evt* evt = (sinsp_evt*)lua_topointer(ls, 1);
|
||||
const char *rule = (char *) lua_tostring(ls, 2);
|
||||
|
Reference in New Issue
Block a user