-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLOError.j
45 lines (36 loc) · 1.17 KB
/
LOError.j
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
/*
* Created by Kjell Nilsson on Jun 27, 2012.
* Copyright 2012, All rights reserved.
*/
@import <Foundation/CPObject.j>
@import <Foundation/CPString.j>
@import <Foundation/CPDictionary.j>
LOValidationErrorKeyString = @"LOValidationErrorKeyString";
LOObjectValidationDomainString = @"LOObjectValidationDomainString";
@implementation LOError : CPObject {
int code @accessors;
CPString domain @accessors;
CPDictionary userInfo @accessors;
}
+ (CPString)LOObjectValidationDomainString {
return LOObjectValidationDomainString;
}
+ (CPString)LOValidationErrorKeyString {
return LOValidationErrorKeyString;
}
+ (id)errorWithDomain:(CPString)aDomain code:(int)aCode userInfo:(CPDictionary)aUserInfo {
return [[LOError alloc] initWithDomain:aDomain code:aCode userInfo:aUserInfo];
}
- (id)initWithDomain:(CPString)aDomain code:(int)aCode userInfo:(CPDictionary)aUserInfo {
self = [super init];
if (self) {
domain = aDomain;
code = aCode;
userInfo = aUserInfo;
}
return self;
}
- (CPString)description {
return [CPString stringWithFormat:@"<%@ Domain: %@ Code: %@ userInfo: %@>", [self className], domain, code, userInfo];
}
@end