Differences From Artifact [6a16e70139]:
- File src/exceptions/OFHTTPRequestFailedException.m — part of check-in [e40729d406] at 2013-02-12 18:22:15 on branch trunk — Prefix all ivars with an underscore. (user: js, size: 2226) [annotate] [blame] [check-ins using]
To Artifact [00ce035b14]:
- File
src/exceptions/OFHTTPRequestFailedException.m
— part of check-in
[d9ddc4d06e]
at
2013-02-13 23:10:35
on branch trunk
— Don't cache the description of exceptions.
This was pretty pointless, as it's usually only used once. (user: js, size: 2032) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
19 20 21 22 23 24 25 | #include <stdlib.h> #import "OFHTTPRequestFailedException.h" #import "OFString.h" #import "OFHTTPRequest.h" #import "OFHTTPRequestReply.h" | < | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#include <stdlib.h>
#import "OFHTTPRequestFailedException.h"
#import "OFString.h"
#import "OFHTTPRequest.h"
#import "OFHTTPRequestReply.h"
#import "common.h"
@implementation OFHTTPRequestFailedException
+ (instancetype)exceptionWithClass: (Class)class
request: (OFHTTPRequest*)request
reply: (OFHTTPRequestReply*)reply
{
|
| ︙ | ︙ | |||
66 67 68 69 70 71 72 |
[_reply release];
[super dealloc];
}
- (OFString*)description
{
| < < < < < | < < < < < | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
[_reply release];
[super dealloc];
}
- (OFString*)description
{
const char *type = "(unknown)";
switch ([_request requestType]) {
case OF_HTTP_REQUEST_TYPE_GET:
type = "GET";
break;
case OF_HTTP_REQUEST_TYPE_HEAD:
type = "HEAD";
break;
case OF_HTTP_REQUEST_TYPE_POST:
type = "POST";
break;
}
return [OFString stringWithFormat:
@"A HTTP %s request in class %@ with URL %@ failed with code %d",
type, _inClass, [_request URL], [_reply statusCode]];
}
- (OFHTTPRequest*)request
{
OF_GETTER(_request, NO)
}
- (OFHTTPRequestReply*)reply
{
OF_GETTER(_reply, NO)
}
@end
|