CPObjectCPException
@implementation CPException : CPObject
An example of throwing an exception in Objective-J:
// some code here... if (input == nil) [CPException raise:"MyException" reason:"You didn't do something right."]; // code that gets executed if no exception was raised
Method Summary | |
---|---|
+(CPException) | exceptionWithName:(CPString)aName reason:(CPString)aReason userInfo:(CPDictionary)aUserInfo Creates an exception with a name, reason and user info. |
+(void) | raise:(CPString)aName reason:(CPString)aReason Raises an exception with a name and reason. |
-(id) | initWithCoder:(CPCoder)aCoder Initializes the exception with data from a coder. |
-(id) | initWithName:(CPString)aName reason:(CPString)aReason userInfo:(CPDictionary)aUserInfo Initializes the exception. |
-(id) | copy Makes a deep copy of the receiver. |
-(CPString) | description Returns the exception's reason. |
-(void) | encodeWithCoder:(CPCoder)aCoder Encodes the exception's data into a coder. |
-(CPString) | name Returns the name of the exception. |
-(void) | raise Raises the exception and causes the program to go to the exception handler. |
-(CPString) | reason Returns the reason for the exception. |
-(CPDictionary) | userInfo Returns data containing info about the receiver. |
Method Detail |
---|
+(CPException)exceptionWithName:(CPString)aName reason:(CPString)aReason userInfo:(CPDictionary)aUserInfo
aName
- the name of the exceptionaReason
- the reason the exception occurredaUserInfo
- a dictionary containing information about the exception+(void)raise:(CPString)aName reason:(CPString)aReason
aName
- the name of the exception to raiseaReason
- the reason for the exception-(id)initWithCoder:(CPCoder)aCoder
aCoder
- the coder from which to read the exception data-(id)initWithName:(CPString)aName reason:(CPString)aReason userInfo:(CPDictionary)aUserInfo
aName
- the name of the exceptionaReason
- the reason for the exceptionaUserInfo
- a dictionary containing information about the exception-(id)copy
-(CPString)description
-(void)encodeWithCoder:(CPCoder)aCoder
aCoder
- the coder to which the data will be written-(CPString)name
-(void)raise
-(CPString)reason
-(CPDictionary)userInfo
Created on Sat Sep 13 14:15:43 PDT 2008