56 var result =
new Error();
57 result.isa = [
self class];
81 reason:"raise:format: the format can't be 'nil'"];
83 var aReason = ObjectiveJ.sprintf.apply(
this, Array.prototype.slice.call(arguments, 3));
114 _userInfo = aUserInfo;
162 if (!anObject || !anObject.isa)
165 return [anObject isKindOfClass:CPException] &&
166 name === [anObject name] &&
167 message === [anObject message] &&
168 (_userInfo === [anObject userInfo] || ([_userInfo isEqual:[anObject userInfo]]));
177 return [[
self class] exceptionWithName:name reason:message userInfo:_userInfo];
195 if (
self = [super
init])
197 name = [aCoder decodeObjectForKey:CPExceptionNameKey];
198 message = [aCoder decodeObjectForKey:CPExceptionReasonKey];
199 _userInfo = [aCoder decodeObjectForKey:CPExceptionUserInfoKey];
211 [aCoder encodeObject:name forKey:CPExceptionNameKey];
212 [aCoder encodeObject:message forKey:CPExceptionReasonKey];
213 [aCoder encodeObject:_userInfo forKey:CPExceptionUserInfoKey];
221 Error.prototype._userInfo = null;
225 #define METHOD_CALL_STRING()\ 226 ((class_isMetaClass(anObject.isa) ? "+" : "-") + "[" + [anObject className] + " " + aSelector + "]: ") 228 function _CPRaiseInvalidAbstractInvocation(anObject, aSelector)
230 [
CPException raise:CPInvalidArgumentException
reason:@"*** -" + sel_getName(aSelector) + @" cannot be sent to an abstract object of class " + [anObject className] + @": Create a concrete instance!"];
233 function _CPRaiseInvalidArgumentException(anObject, aSelector, aMessage)
236 reason:METHOD_CALL_STRING() + aMessage];
239 function _CPRaiseRangeException(anObject, aSelector, anIndex, aCount)
242 reason:METHOD_CALL_STRING() + "index (" + anIndex + ") beyond bounds (" + aCount + ")"];
245 function _CPReportLenientDeprecation( aClass, oldSelector, newSelector)
Used to implement exception handling (creating & raising).
function CPStringFromClass(aClass)
var CPExceptionUserInfoKey
void raise:reason:(CPString aName, [reason] CPString aReason)
CPInvalidArgumentException
A mutable key-value pair collection.
An immutable string (collection of characters).
CPInternalInconsistencyException
CPUnsupportedMethodException
Defines methods for use when archiving & restoring (enc/decoding).
id initWithName:reason:userInfo:(CPString aName, [reason] CPString aReason, [userInfo] CPDictionary aUserInfo)
function CPStringFromSelector(aSelector)
CPException exceptionWithName:reason:userInfo:(CPString aName, [reason] CPString aReason, [userInfo] CPDictionary aUserInfo)
FrameUpdater prototype description