There is some code which doesn't work as I would like, and I don't know whom to blame, so I'm starting with you.
I use SciTE on GTK3, and I have installed LGI — bindings to the whole GLib/GObject stack for Lua. Some of the libraries included in the bindings provide asynchronous I/O by means of callbacks: a callback is passed, an appropriate hook is set up in the GLib main loop (which GTK sets up and maintains), and when the results are ready, the callback is invoked in an unprotected Lua environment. Which means that any
error() in the callback results in calling the panic handler and immediate program exit, using
exit() (in Lua 5.2 this changes to
abort(), which is marginally more useful).
I would expect SciTE to display the message somewhere, gracefully jump back to the main event loop and continue running.
Even if the issue is to be solved at the binding or Lua level, the current Lua panic handler is not very useful. Currently it sends a message to the output pane, but since the Lua interpreter then immediately exits, the error message is never displayed anywhere.