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
|
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
|
-
+
-
-
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
+
-
+
|
*/
#import "MTXLogoutFailedException.h"
#import "MTXClient.h"
@implementation MTXClientException
+ (instancetype)exceptionWithClient: (MTXClient *)client
+ (instancetype)exceptionWithStatusCode: (int)statusCode
statusCode: (int)statusCode
response: (mtx_response_t)response
response: (mtx_response_t)response
client: (MTXClient *)client
{
return [[[self alloc] initWithClient: client
return [[[self alloc] initWithStatusCode: statusCode
statusCode: statusCode
response: response] autorelease];
response: response
client: client] autorelease];
}
- (instancetype)initWithClient: (MTXClient *)client
statusCode: (int)statusCode
response: (mtx_response_t)response
- (instancetype)initWithStatusCode: (int)statusCode
response: (mtx_response_t)response
client: (MTXClient *)client
{
self = [super init];
@try {
_client = [client retain];
_statusCode = statusCode;
_response = [response copy];
_client = [client retain];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
[_client release];
[_response release];
[_client release];
[super dealloc];
}
@end
|