You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when an error occurs inside a callback, it displays the error message via a gtk warning, but it doesn't display a proper stack trace like a normal Lua error. This makes debugging problems inside callbacks hard.
Example code:
locallgi=require"lgi"localGtk=lgi.Gtklocalfunctionevil_code(w)
w:add(nil)
endlocalfunctionsome_stuff(w)
evil_code(w)
endlocalwindow=Gtk.Window{
on_destroy=Gtk.main_quit,
Gtk.Button{
label="Click to crash",
margin=10,
on_clicked=function(w)
some_stuff(w)
end
}
}
window:show_all()
Gtk.main()
example output after causing an error:
(lua:4090): Lgi-WARNING **: Error raised while calling 'lgi.cbk (function: 0x1001410): GObject': /usr/local/share/lua/5.1/lgi/override/Gtk.lua:139: bad argument #3 to 'add' (Gtk.Widget expected, got nil)
expected output: a full stack trace similar to this
lua: ./error_test.lua:6: attempt to index local 'w' (a nil value)
stack traceback:
./error_test.lua:6: in function 'evil_code'
./error_test.lua:10: in function 'some_stuff'
./error_test.lua:14: in function <./error_test.lua:13>
./error_test.lua:15: in main chunk
Using lgi 0.9.0 under Gentoo Linux x86_64, with Gtk 3.16.7
The text was updated successfully, but these errors were encountered:
Currently when an error occurs inside a callback, it displays the error message via a gtk warning, but it doesn't display a proper stack trace like a normal Lua error. This makes debugging problems inside callbacks hard.
Example code:
example output after causing an error:
expected output: a full stack trace similar to this
Using lgi 0.9.0 under Gentoo Linux x86_64, with Gtk 3.16.7
The text was updated successfully, but these errors were encountered: