mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
lua: Print traceback on startup errors
We do some special magic so that we can have tracebacks on errors messages. However, the code for parsing the rc.lua called it without this magic and thus errors didn't have tracebacks. This is bad, because if something goes wrong in e.g. wibox.widget.textbox, you don't really have any clue where this error is coming from. Fix this by adding our "print traceback on error"-magic here, too. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
14daf85fe9
commit
0c62831eea
1 changed files with 4 additions and 1 deletions
5
luaa.c
5
luaa.c
|
@ -666,7 +666,10 @@ luaA_loadrc(const char *confpath, bool run)
|
||||||
/* Set the conffile right now so it can be used inside the
|
/* Set the conffile right now so it can be used inside the
|
||||||
* configuration file. */
|
* configuration file. */
|
||||||
conffile = a_strdup(confpath);
|
conffile = a_strdup(confpath);
|
||||||
if(lua_pcall(globalconf.L, 0, LUA_MULTRET, 0))
|
/* Move error handling function before function */
|
||||||
|
lua_pushcfunction(globalconf.L, luaA_dofunction_on_error);
|
||||||
|
lua_insert(globalconf.L, -2);
|
||||||
|
if(lua_pcall(globalconf.L, 0, LUA_MULTRET, -2))
|
||||||
{
|
{
|
||||||
const char *err = lua_tostring(globalconf.L, -1);
|
const char *err = lua_tostring(globalconf.L, -1);
|
||||||
luaA_startup_error(err);
|
luaA_startup_error(err);
|
||||||
|
|
Loading…
Reference in a new issue