Core Data throws/catches exceptions internally during normal use.

Originator:numist
Number:rdar://13828201 Date Originated:07-May-2013 10:35 AM
Status:Open Resolved:
Product:iOS SDK Product Version:6.1
Classification:Serious Bug Reproducible:Always
 
Good Objective-C practices prescribe the use of exceptions only in the case of unrecoverable conditions caused by coder error, especially since ARC makes them much more expensive to throw. This restriction is really helpful for debugging, since a breakpoint set to fire when an exception is thrown should always break on error conditions.

Unfortunately, Core Data catches exceptions (I'm actually not sure if it throws them intentionally or if it's abusing the code beneath it) during normal use. The exceptions never escape Core Data's context, but exception breakpoints are still triggered, making debugging onerous. Core Data should not be throwing exceptions.

A workaround exists in the form of a conditional breakpoint: http://restkit.tumblr.com/post/40736602228/dealing-with-core-data-phantom-breakpoints

Comments

This is normal behavior. When CoreData hits a merge conflict it raises an exception, then attempts to handle it using whatever merge policy the developer has set.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!