Used to implement exception handling (creating & raising). More...
Public Member Functions | |
| (id) | - copy [implementation] |
| (CPString) | - description [implementation] |
| (void) | - encodeWithCoder: [implementation] |
| (id) | - initWithCoder: [implementation] |
| (id) | - initWithName:reason:userInfo: [implementation] |
| (CPString) | - name [implementation] |
| (void) | - raise [implementation] |
| (CPString) | - reason [implementation] |
| (CPDictionary) | - userInfo [implementation] |
Static Public Member Functions | |
| (id) | + alloc [implementation] |
| (CPException) | + exceptionWithName:reason:userInfo: [implementation] |
| (void) | + raise:reason: [implementation] |
Used to implement exception handling (creating & raising).
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 47 of file CPException.j.
| + (id) alloc | [implementation] |
Definition at line 55 of file CPException.j.
| - (id) copy | [implementation] |
Definition at line 147 of file CPException.j.
| - (CPString) description | [implementation] |
Returns the exception's reason.
Definition at line 130 of file CPException.j.
| - (void) encodeWithCoder: | (CPCoder) | aCoder | [implementation] |
Encodes the exception's data into a coder.
| aCoder | the coder to which the data will be written |
Definition at line 183 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.
| aName | the name of the exception | |
| aReason | the reason the exception occurred | |
| aUserInfo | a dictionary containing information about the exception |
Definition at line 77 of file CPException.j.
| - (id) initWithCoder: | (CPCoder) | aCoder | [implementation] |
Initializes the exception with data from a coder.
| aCoder | the coder from which to read the exception data |
Definition at line 165 of file CPException.j.
| - (id) initWithName: | (CPString) | aName | ||
| reason: | (CPString) | aReason | ||
| userInfo: | (CPDictionary) | aUserInfo | ||
[implementation] |
Initializes the exception.
| aName | the name of the exception | |
| aReason | the reason for the exception | |
| aUserInfo | a dictionary containing information about the exception |
Definition at line 89 of file CPException.j.
| - (CPString) name | [implementation] |
Returns the name of the exception.
Definition at line 106 of file CPException.j.
| - (void) raise | [implementation] |
Raises the exception and causes the program to go to the exception handler.
Definition at line 138 of file CPException.j.
Raises an exception with a name and reason.
| aName | the name of the exception to raise | |
| aReason | the reason for the exception |
Definition at line 65 of file CPException.j.
| - (CPString) reason | [implementation] |
Returns the reason for the exception.
Definition at line 114 of file CPException.j.
| - (CPDictionary) userInfo | [implementation] |
Returns data containing info about the receiver.
Definition at line 122 of file CPException.j.
1.6.1