• 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
Crashing on all relevant exceptions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Crashing on all relevant exceptions
      • From: Chris Suter <email@hidden>
    • Re: Crashing on all relevant exceptions
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: [Newbie question] Subclassing NSButton
  • Next by Date: [Moderator] List guidelines and related resources
  • Previous by thread: Test - Please disregard
  • Next by thread: Re: Crashing on all relevant exceptions
  • Index(es):
    • Date
    • Thread