55 var result =
new Error();
56 result.isa = [
self class];
80 reason:"raise:format: the format can't be 'nil'"];
82 var aReason = ObjectiveJ.sprintf.apply(
this, Array.prototype.slice.call(arguments, 3));
113 _userInfo = aUserInfo;
161 if (!anObject || !anObject.isa)
164 return [anObject isKindOfClass:CPException] &&
165 name === [anObject name] &&
166 message === [anObject message] &&
167 (_userInfo === [anObject userInfo] || ([_userInfo isEqual:[anObject userInfo]]));
176 return [[
self class] exceptionWithName:name reason:message userInfo:_userInfo];
194 if (
self = [super
init])
196 name = [aCoder decodeObjectForKey:CPExceptionNameKey];
197 message = [aCoder decodeObjectForKey:CPExceptionReasonKey];
198 _userInfo = [aCoder decodeObjectForKey:CPExceptionUserInfoKey];
210 [aCoder encodeObject:name forKey:CPExceptionNameKey];
211 [aCoder encodeObject:message forKey:CPExceptionReasonKey];
212 [aCoder encodeObject:_userInfo forKey:CPExceptionUserInfoKey];
220 Error.prototype._userInfo = null;
224 #define METHOD_CALL_STRING()\
225 ((class_isMetaClass(anObject.isa) ? "+" : "-") + "[" + [anObject className] + " " + aSelector + "]: ")
227 function _CPRaiseInvalidAbstractInvocation(anObject, aSelector)
229 [
CPException raise:CPInvalidArgumentException
reason:@"*** -" + sel_getName(aSelector) + @" cannot be sent to an abstract object of class " + [anObject className] + @": Create a concrete instance!"];
232 function _CPRaiseInvalidArgumentException(anObject, aSelector, aMessage)
235 reason:METHOD_CALL_STRING() + aMessage];
238 function _CPRaiseRangeException(anObject, aSelector, anIndex, aCount)
241 reason:METHOD_CALL_STRING() + "index (" + anIndex + ") beyond bounds (" + aCount + ")"];
244 function _CPReportLenientDeprecation( aClass, oldSelector, newSelector)