Differences From Artifact [89529e8143]:
- File src/exceptions/OFHTTPRequestFailedException.m — part of check-in [917ce5754c] at 2012-12-22 15:37:19 on branch trunk — Add -[doesNotRecognizeSelector:]. (user: js, size: 2196) [annotate] [blame] [check-ins using]
To Artifact [df49588af1]:
- File
src/exceptions/OFHTTPRequestFailedException.m
— part of check-in
[75f187cef5]
at
2012-12-26 20:55:27
on branch trunk
— OFHTTPRequestResult -> OFHTTPRequestReply.
The class also has its own file now. (user: js, size: 2215) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include "config.h" #include <stdlib.h> #import "OFHTTPRequestFailedException.h" #import "OFString.h" #import "OFHTTPRequest.h" #import "autorelease.h" #import "common.h" @implementation OFHTTPRequestFailedException + (instancetype)exceptionWithClass: (Class)class_ request: (OFHTTPRequest*)request | > | | | | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | #include "config.h" #include <stdlib.h> #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 reply: (OFHTTPRequestReply*)reply { return [[[self alloc] initWithClass: class_ request: request reply: reply] autorelease]; } - initWithClass: (Class)class_ { @try { [self doesNotRecognizeSelector: _cmd]; abort(); } @catch (id e) { [self release]; @throw e; } } - initWithClass: (Class)class_ request: (OFHTTPRequest*)request_ reply: (OFHTTPRequestReply*)reply_ { self = [super initWithClass: class_]; request = [request_ retain]; reply = [reply_ retain]; return self; } - (void)dealloc { [request release]; [reply release]; [super dealloc]; } - (OFString*)description { void *pool; |
︙ | ︙ | |||
86 87 88 89 90 91 92 | break; } pool = objc_autoreleasePoolPush(); description = [[OFString alloc] initWithFormat: @"A HTTP %s request in class %@ with URL %@ failed with code %d", | | | | | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | break; } pool = objc_autoreleasePoolPush(); description = [[OFString alloc] initWithFormat: @"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) } - (OFHTTPRequestReply*)reply { OF_GETTER(reply, NO) } @end |