[Pyobjc-dev] ObjC exceptions, Python exceptions, the event loop
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2003-01-18 12:06:17
|
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". Additionally, if the exception is OC_PythonException, the _original_ Python exception should be reraised, resulting in a decent traceback. It would also allow us to catch exceptions raised by the event loop, and simply continue if it wasn't fatal enough (whatever that means ;-). Just |