Fwd: carbon throwing objc exceptions
Fwd: carbon throwing objc exceptions
- Subject: Fwd: carbon throwing objc exceptions
- From: Shawn Erickson <email@hidden>
- Date: Mon, 14 Sep 2009 13:57:19 -0700
...oops meant to reply to all not just Joel....
On Fri, Sep 11, 2009 at 2:40 PM, Joel Reymont
<email@hidden> wrote:
I think this is ham-handed use of ObjC exceptions but I'm told that this is done this way because Carbon can throw ObjC exceptions. Can someone confirm this, please, or suggest a less evil way of handling ObjC exceptions arising from Carbon?
Why are you attempting to catch the except at all? It looks like no attempt is made to deal with the exception and in general exceptions in Cocoa are truly exceptional and imply a mistake by the programmer.
I wouldn't attempt to catch the exception but instead let a top level handler get it and then make a decision to log at that point (look at NSExceptionHandler).
Of course if you are trying to "handle" exceptions from propagating into C++, etc. code that knows nothing about them (in 32b) then attempting to catch them may or may not make sense depending on what you plan to do to handle them. Again exceptions are almost always a bug on the part of the programmer and not something you would see in a normally running program (outside of distributed objects, etc.).
Also CoreFoundation is not Carbon.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden