53 var result =
new Error();
54 result.isa = [
self class];
95 _userInfo = aUserInfo;
143 if (!anObject || !anObject.isa)
146 return [anObject isKindOfClass:CPException] &&
147 name === [anObject name] &&
148 message === [anObject message] &&
149 (_userInfo === [anObject userInfo] || ([_userInfo isEqual:[anObject userInfo]]));
158 return [[
self class] exceptionWithName:name reason:message userInfo:_userInfo];
176 if (
self = [super init])
178 name = [aCoder decodeObjectForKey:CPExceptionNameKey];
179 message = [aCoder decodeObjectForKey:CPExceptionReasonKey];
180 _userInfo = [aCoder decodeObjectForKey:CPExceptionUserInfoKey];
192 [aCoder encodeObject:name forKey:CPExceptionNameKey];
193 [aCoder encodeObject:message forKey:CPExceptionReasonKey];
194 [aCoder encodeObject:_userInfo forKey:CPExceptionUserInfoKey];
202 Error.prototype._userInfo = null;
206 #define METHOD_CALL_STRING()\
207 ((class_isMetaClass(anObject.isa) ? "+" : "-") + "[" + [anObject className] + " " + aSelector + "]: ")
209 function _CPRaiseInvalidAbstractInvocation(anObject, aSelector)
211 [
CPException raise:CPInvalidArgumentException
reason:@"*** -" + sel_getName(aSelector) + @" cannot be sent to an abstract object of class " + [anObject className] + @": Create a concrete instance!"];
214 function _CPRaiseInvalidArgumentException(anObject, aSelector, aMessage)
217 reason:METHOD_CALL_STRING() + aMessage];
220 function _CPRaiseRangeException(anObject, aSelector, anIndex, aCount)
223 reason:METHOD_CALL_STRING() + "index (" + anIndex + ") beyond bounds (" + aCount + ")"];
226 function _CPReportLenientDeprecation( aClass, oldSelector, newSelector)