Re: NSException category?
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