Re: Exception not being caught
Re: Exception not being caught
On 20 Mar 2011, at 19:17, Rick Mann wrote:
> I have some code, called from a subclass of NSOperation, that throws an exception pretty reliably if I put a breakpoint elsewhere in the code (it is code that does an HTTP request, and it's getting a broken pipe, and raising an exception to report it; the breakpoint (in another thread) seems to trigger this behavior).
>
> My NSOperation subclass wraps the call to the network code in a @try/catch block. But when this exception is raised, the app terminates due to an uncaught exception.
>
> Any idea why?
>
> TIA,
> Rick
>
Can you give us the exception report?
Is it an NSException instance?
The Exception Programming Topics states (amongst lots of other good and relevant stuf):
Exceptions on the main thread of a Cocoa application do not typically rise to the level of the uncaught exception handler because the global application object catches all such exceptions.
This might indicate that your exception is not occurring on your main thread.
Check out the section entitled "Controlling a Program’s Response to Exceptions".
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden