• 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: NSException category?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSException category?


  • Subject: Re: NSException category?
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 06 Feb 2014 11:51:11 -0800

On Feb 6, 2014, at 11:08 AM, Carl Hoefs <email@hidden> wrote:

> If I add a "@throw e;" in the @catch block, would that have the effect of "tagging" the unhandled exceptions with my info context, assuming I could add my own userInfo to it?

If you could mutate the object e, then re-throw it, yes. You're throwing an exception that now has your userInfo in it, so that's what the parent handler will catch.

But it would be more straightforward to create a new NSException object with the same attributes as the one you caught but with your own info added to its userInfo. You can do this with existing APIs without having to add categories or other hacks. Then just throw the new exception.

—Jens
_______________________________________________

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


References: 
 >NSException category? (From: Carl Hoefs <email@hidden>)
 >Re: NSException category? (From: Doug Hill <email@hidden>)
 >Re: NSException category? (From: Carl Hoefs <email@hidden>)

  • Prev by Date: Re: NSException category?
  • Next by Date: Re: NSException category?
  • Previous by thread: Re: NSException category?
  • Next by thread: Re: NSException category?
  • Index(es):
    • Date
    • Thread