Crashing on all relevant exceptions
Crashing on all relevant exceptions
- Subject: Crashing on all relevant exceptions
- From: Aaron Jacobs <email@hidden>
- Date: Sun, 6 Aug 2006 15:31:56 -0700
I've searched on and off for a long time now for a way to do this,
but have never found a posting or discussion thread that deals with
it directly and has a solution.
I subscribe to the idea of using assertions in particular and
exceptions in general to "crash early" (in the words of The Pragmatic
Programmer). The problem I have is that, as I've gathered, NSApp
uses its own exception handler when the run loop executes code as a
result of an event. This handler seems to just log exceptions that
it catches, instead of brining the program down as I'd like. For
example, if I put NSAssert(NO, @"Blah.") in a method that is hooked
up to a button in the interface, I get this when I click the button:
2006-08-06 15:21:27.567 Test App[9111] *** Assertion failure in -
[TestClass test:], /Users/ajacobs/Desktop/TestClass.m:15
2006-08-06 15:21:27.568 Test App[9111] Blah.
That's not good enough for me; I'd like the program to crash so that
if the bug makes it into a production version my users notice and
send me crash reports. I've messed around with the ExceptionHandling
framework, but unless I missed something it does not allow you to
make the application crash on this kind of exception.
Is there any way to disable or preempt this exception handler and any
other ones Cocoa may use that are contrary to my goal?
Aaron Jacobs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden