• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Exception not being caught
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exception not being caught


  • Subject: Re: Exception not being caught
  • From: "email@hidden" <email@hidden>
  • Date: Sun, 20 Mar 2011 19:45:16 +0000


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

  • Follow-Ups:
    • Re: Exception not being caught
      • From: Rick Mann <email@hidden>
References: 
 >Exception not being caught (From: Rick Mann <email@hidden>)

  • Prev by Date: Exception not being caught
  • Next by Date: TableView sorts and then it doesn't
  • Previous by thread: Exception not being caught
  • Next by thread: Re: Exception not being caught
  • Index(es):
    • Date
    • Thread