Re: App Will Not Terminate After Uncaught Excpetion
Re: App Will Not Terminate After Uncaught Excpetion
- Subject: Re: App Will Not Terminate After Uncaught Excpetion
- From: Jean-Daniel Dupas <email@hidden>
- Date: Thu, 16 Dec 2010 17:40:58 +0100
Le 16 déc. 2010 à 17:32, Nick Zitzmann a écrit :
>
> On Dec 16, 2010, at 6:38 AM, Andreas Grosam wrote:
>
>> In Cocoa, exceptions are considered fatal errors, and code is usually not exception safe.
>
> [citation needed]
>
From "Introduction to Exception Programming Topics for Cocoa"
“Important: You should reserve the use of exceptions for programming or unexpected runtime errors such as out-of-bounds collection access, attempts to mutate immutable objects, sending an invalid message, and losing the connection to the window server. You usually take care of these sorts of errors with exceptions when an application is being created rather than at runtime.
If you have an existing body of code (such as third-party library) that uses exceptions to handle error conditions, you may use the code as-is in your Cocoa application. But you should ensure that any expected runtime exceptions do not escape from these subsystems and end up in the caller’s code. For example, a parsing library might use exceptions internally to indicate problems and enable a quick exit from a parsing state that could be deeply recursive; however, you should take care to catch such exceptions at the top level of the library and translate them into an appropriate return code or state.”
-- Jean-Daniel
_______________________________________________
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