@@ -21,11 +21,10 @@ #import "OFHTTPRequestFailedException.h" #import "OFString.h" #import "OFHTTPRequest.h" #import "OFHTTPRequestReply.h" -#import "autorelease.h" #import "common.h" @implementation OFHTTPRequestFailedException + (instancetype)exceptionWithClass: (Class)class request: (OFHTTPRequest*)request @@ -68,16 +67,12 @@ [super dealloc]; } - (OFString*)description { - void *pool; const char *type = "(unknown)"; - if (_description != nil) - return _description; - switch ([_request requestType]) { case OF_HTTP_REQUEST_TYPE_GET: type = "GET"; break; case OF_HTTP_REQUEST_TYPE_HEAD: @@ -86,19 +81,13 @@ case OF_HTTP_REQUEST_TYPE_POST: type = "POST"; break; } - pool = objc_autoreleasePoolPush(); - - _description = [[OFString alloc] initWithFormat: + return [OFString stringWithFormat: @"A HTTP %s request in class %@ with URL %@ failed with code %d", type, _inClass, [_request URL], [_reply statusCode]]; - - objc_autoreleasePoolPop(pool); - - return _description; } - (OFHTTPRequest*)request { OF_GETTER(_request, NO)