Open GoogleCodeExporter opened 9 years ago
Also, STAssertThrowsSpecific does not work with non-NSExceptions.
Original comment by alejandr...@gmail.com
on 24 Dec 2010 at 12:45
Out of curiosity why are you throwing exceptions that don't inherit from
NSException?
http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/Exception
s/Tasks/RaisingExceptions.html
Original comment by dmaclach
on 3 Jan 2011 at 8:47
fyi -
http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Exception
s/Tasks/HandlingExceptions.html
"""Important: Although you can throw and catch objects other than NSException
objects, the Cocoa frameworks themselves might only catch NSException objects
for some conditions. So if you throw other types of objects, the Cocoa handlers
for that exception might not run, with undefined results. (Conversely,
non-NSException objects that you throw could be caught by some Cocoa handlers.)
For these reasons, it is recommended that you throw NSException objects only,
while being prepared to catch exception objects of all types."""
Original comment by thoma...@gmail.com
on 3 Jan 2011 at 8:48
I use exceptions that don't inherit from NSException because I wanted a
light(er) weight exception class. In particular I don't want to provide a name
and a reason strings, but I do want to include custom information. Also I want
to differentiate between my exception and system exceptions via different
@catch statements -- I don't want to catch system exceptions.
Original comment by alejandr...@gmail.com
on 3 Jan 2011 at 10:24
Original issue reported on code.google.com by
alejandr...@gmail.com
on 24 Dec 2010 at 12:30