On Mon, Jun 3, 2013 at 2:13 AM, Paul K <paulclin...@yahoo.com> wrote:
> Hi John,
>
> I've been looking for ways to catch and report run-time errors in the
> application. Lua errors are covered with your recent support for
> EVT_LUA_ERROR (http://sourceforge.net/p/wxlua/svn/180/), but there are
> still fatal exceptions in the application that may happen.
>
> As far as I can see from wxwdigets docs, these are controlled by
> wxHandleFatalExceptions and OnFatalExceptions; wxlua does provide a
> methods for wxHandleFatalExceptions, but I don't see anything similar
> to OnFatalExceptions? How do I get set up a handler that gets called
> when a fatal exception happens? It would be super useful to also have
> a way to access Lua state from it to gather Lua stack information to
> include in the crash report. Or is there an existing alternative I am
> missing?
>
>
I have not used these functions, but typically there is not a lot that can
be done at that point since, it is... fatal. Digging through the Lua stack,
which may have been the problem in the first place, may be too much.
> Would it be possible to use OnFatalExceptions to set a callback (a Lua
> function) that will be called when a fatal exception happens?
>
>
This is a MSVC only thing, do you use it or MingW?
http://docs.wxwidgets.org/trunk/group__group__funcmacro__appinitterm.html#ga28a4fb827b93fa6bac18c9666c23ee10
> While we are on the topic of crash reports, there is wxDebugReport,
> but it doesn't seem to be available in the binding. Does it make sense
> to expose it, or is it better try to gather and report as much as
> possible at the Lua level?
>
>
It would be nice to have, but I have not used it so I don't know how much
work it is. At first glance it seems like you could use it without having
to override any virtual functions which makes binding it much simpler.
> Also, there are some other methods documents (OnExceptionInMainLoop
> and OnUnhandledException) and I can't figure out if these are also
> needed or if OnFatalExceptions is enough if exposed in wxlua. Thank
> you!
>
I can't tell from the docs what the difference between them really are.
Presumably, OnExcept... and OnUnhandl... are caught earlier? I think for
your purpose OnFatal... is what you want.
Regards,
John
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users