CPException Class Reference
[Foundation]

List of all members.

Public Member Functions

(id) - initWithName:reason:userInfo: [implementation]
(CPString- name [implementation]
(CPString- reason [implementation]
(CPDictionary- userInfo [implementation]
(CPString- description [implementation]
(void) - raise [implementation]
(id) - copy [implementation]
(id) - initWithCoder: [implementation]
(void) - encodeWithCoder: [implementation]

Static Public Member Functions

(void) + raise:reason: [implementation]
(CPException+ exceptionWithName:reason:userInfo: [implementation]


Detailed Description

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

Definition at line 45 of file CPException.j.


Member Function Documentation

- (id) copy   [implementation]

Definition at line 144 of file CPException.j.

- (CPString) description   [implementation]

Returns the exception's reason.

Definition at line 127 of file CPException.j.

- (void) encodeWithCoder: (CPCoder aCoder   [implementation]

Encodes the exception's data into a coder.

Parameters:
aCoder the coder to which the data will be written

Definition at line 180 of file CPException.j.

+ (CPException) exceptionWithName: (CPString aName
reason: (CPString aReason
userInfo: (CPDictionary aUserInfo 
[implementation]

Creates an exception with a name, reason and user info.

Parameters:
aName the name of the exception
aReason the reason the exception occurred
aUserInfo a dictionary containing information about the exception
Returns:
the new exception

Definition at line 74 of file CPException.j.

- (id) initWithCoder: (CPCoder aCoder   [implementation]

Initializes the exception with data from a coder.

Parameters:
aCoder the coder from which to read the exception data
Returns:
the initialized exception

Definition at line 162 of file CPException.j.

- (id) initWithName: (CPString aName
reason: (CPString aReason
userInfo: (CPDictionary aUserInfo 
[implementation]

Initializes the exception.

Parameters:
aName the name of the exception
aReason the reason for the exception
aUserInfo a dictionary containing information about the exception
Returns:
the initialized exception

Definition at line 86 of file CPException.j.

- (CPString) name   [implementation]

Returns the name of the exception.

Definition at line 103 of file CPException.j.

- (void) raise   [implementation]

Raises the exception and causes the program to go to the exception handler.

Definition at line 135 of file CPException.j.

+ (void) raise: (CPString aName
reason: (CPString aReason 
[implementation]

Raises an exception with a name and reason.

Parameters:
aName the name of the exception to raise
aReason the reason for the exception

Definition at line 62 of file CPException.j.

- (CPString) reason   [implementation]

Returns the reason for the exception.

Definition at line 111 of file CPException.j.

- (CPDictionary) userInfo   [implementation]

Returns data containing info about the receiver.

Definition at line 119 of file CPException.j.


The documentation for this class was generated from the following file:

Generated on Wed May 20 12:44:00 2009 for Cappuccino by  doxygen 1.5.8