You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Create a unit test that throws a custom exception not extending NSException
2. Build and run
What is the expected output? What do you see instead?
I would expect the exception to be caught and a description printed out,
instead the program crashes and I get
*** Terminating app due to uncaught exception of class 'SLError'
terminate called after throwing an instance of 'SLError'
What version of the product are you using? On what operating system?
Revision: 420
iPhone 4.2 project on XCode 3.2.5
Please provide any additional information below.
Original issue reported on code.google.com by alejandr...@gmail.com on 24 Dec 2010 at 12:30
The text was updated successfully, but these errors were encountered:
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:30The text was updated successfully, but these errors were encountered: