Re: [Pyobjc-dev] ObjC exceptions, Python exceptions, the event loop
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-01-18 12:49:58
|
On Saturday, Jan 18, 2003, at 13:06 Europe/Amsterdam, Just van Rossum wrote: > I'm wondering about ObjC exceptions: if an app throws an exception, > could it be caught by the code that invokes the event loop? Hm, > considering the call stack, I would think so. If this is indeed so, I > would suggest to catch all exceptions in the AppKit.NSApplicationMain > wrapper and convert it to a Python exception. Since the main program is > a Python program, it makes sense for it to end as a real Python program > instead of "crashing". Your right. Somehow I forgot to add a try-block around the call to NSApplicationMain. The core module already does this for methodcalls. > > Additionally, if the exception is OC_PythonException, the _original_ > Python exception should be reraised, resulting in a decent traceback. The support-code for exceptions in objc_util.m should do that, but I'm not entirely sure if we raise the same exception or a copy of it. Ronald |