Ok. I implemented Kernel.Protect.
basicly you encase a function object like so
and it will catch any raised errors and log them with Kernel.Log and Kernel.Log will in turn inform the user of the error with a message box IF the wx.app has been created.
so a normal function call looks like this
a protected function call would look like this
Kernel.Protect(self.func_obj)(*args)
it is particularly important when a function is called by a wxpython event as once an error has been raised and passes into a C++ wxpthon portion of the call stack it can't be caught anymore. wxpython will catch the error print it to stdout and try to continue as if nothing happened if the error isn't caught before this point.
so when binding a function to a wxpython event if the function could reasonably throw an error wrap the function with Kernel.Protect like so
self.Bind(wx.EVT_X, Kernel.Protect(self.OnEventX))
instead of the normal Bind call
self.Bind(wx.EVT_X, self.OnEventX)