Hi,

On 11.06.2013 21:42, kardan wrote:
[...]
> -            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))
> 
> If I get it right, your commit adds a warning when parsing the
> config failes on runtime. Do you think it's a good start to use this
> for warnings on deprecated terms?
> 
> http://git.naquadah.org/?p=awesome.git;a=blobdiff;f=luaa.c;h=7c94dac0d247657c815aafa97632853157e4db57;hp=d484172310dc0a1fdd40473507d4bcd3a3435018;hb=3739aabda1323dc488c5150aed166e2fd37edf56;hpb=3f259d0ed2469eb4bfea565628e38138c9c1c06f

That URL seems wrong. It seems like you meant to quote this one instead
(otherwise: Why are you digging out ancient commits?):

http://git.naquadah.org/?p=awesome.git;a=commitdiff;h=0c62831eea5e651577928ef8b09c947565eaed7d

What this does is best illustrated with an example, I think. Add this to your
rc.lua:

local f
f = function(i)
  if i > 0 then return f(i-1) end
  error("foo")
end
f(4)

Before the commit, you would get the following error message from awesome:

/home/psychon/.config/awesome/rc.lua:4: foo

After the commit, you get this instead:

error while running function
stack traceback:
        [C]: in function 'error'
        /home/psychon/.config/awesome/rc.lua:4: in function
</home/psychon/.config/awesome/rc.lua:2>
        (tail call): ?
        (tail call): ?
        (tail call): ?
        (tail call): ?
        /home/psychon/.config/awesome/rc.lua:6: in main chunk
error: /home/psychon/.config/awesome/rc.lua:4: foo

Meh. This is not really a good example due to the tail call. However, as you see
this now contains a backtrace.

The reason I did this was that someone on IRC had a problem with
wibox.widget.textbox. textbox.set_markup() was called with argument nil and it
was hard to figure out where this "nil" came from. The traceback would have made
this a lot easier.

Cheers,
Uli
-- 
- He made himself, me nothing, you nothing out of the dust
- Er machte sich mir nichts, dir nichts aus dem Staub

-- 
To unsubscribe, send mail to [email protected].

Reply via email to