Re: Exception not being caught
Re: Exception not being caught
- Subject: Re: Exception not being caught
- From: Rick Mann <email@hidden>
- Date: Sun, 20 Mar 2011 21:11:38 -0700
On Mar 20, 2011, at 12:45 PM, email@hidden wrote:
>
>
> 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?
Yes. It is raised by this line of code:
[NSException raise:NSInvalidArchiveOperationException format:@"Network error domain:%@ code:%d", [requestError domain], [requestError code]];
> This might indicate that your exception is not occurring on your main thread.
It is most certainly NOT occurring on the main thread. Never said it was (in fact, I figured the bit about NSOperation would imply it was not).
Here's the trace:
2011-03-20 18:41:13.233 MissionClock[17979:7e03] *** Terminating app due to uncaught exception 'NSInvalidArchiveOperationException', reason: 'Network error domain:NSURLErrorDomain code:-1005'
*** Call stack at first throw:
(
0 CoreFoundation 0x015be5a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01712313 objc_exception_throw + 44
2 CoreFoundation 0x01576ef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x01576e6a +[NSException raise:format:] + 58
4 MissionClock 0x00010920 -[CWDistantHessianObject(Private) sendRequestWithPostData:] + 426
5 MissionClock 0x000115ad -[CWDistantHessianObject forwardInvocation:] + 77
6 CoreFoundation 0x0152fa04 ___forwarding___ + 1124
7 CoreFoundation 0x0152f522 _CF_forwarding_prep_0 + 50
8 MissionClock 0x0001aef8 -[GetMissionListOp main] + 722
9 Foundation 0x00128b76 -[__NSOperationInternal start] + 747
10 Foundation 0x001287ca ____startOperations_block_invoke_2 + 106
11 libdispatch_sim.dylib 0x01bf1289 _dispatch_call_block_and_release + 16
12 libdispatch_sim.dylib 0x01bf458a _dispatch_worker_thread2 + 252
13 libSystem.B.dylib 0x92b46d41 _pthread_wqthread + 390
14 libSystem.B.dylib 0x92b46b86 start_wqthread + 30
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
--
Rick
_______________________________________________
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