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
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
|
*/
#import "MTXLogoutFailedException.h"
#import "MTXClient.h"
@implementation MTXLogoutFailedException
+ (instancetype)exceptionWithClient: (MTXClient *)client
statusCode: (int)statusCode
response: (mtx_response_t)response
{
return [[[self alloc] initWithClient: client
statusCode: statusCode
response: response] autorelease];
}
- (instancetype)initWithClient: (MTXClient *)client
statusCode: (int)statusCode
response: (mtx_response_t)response
{
self = [super init];
@try {
_client = [client retain];
_statusCode = statusCode;
_response = [response copy];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
[_client release];
[_response release];
[super dealloc];
}
- (OFString *)description
{
return [OFString stringWithFormat:
@"Failed to log out user %@: %@", _client.userID, _response];
@"Failed to log out user %@: %@",
self.client.userID, self.response];
}
@end
|