Error

创建

1
2
3
4
5
6
7
/**
快速创建一个error

@param maker error构造器
@return error
*/
+ (instancetype)ax_errorWithMaker:(void (^)(NSErrorMaker *error))maker;

NSErrorMaker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@interface NSErrorMaker : NSObject


// @xaoxuu: NSErrorDomain
@property (copy, nonatomic) NSErrorDomain domain;
// @xaoxuu: error code
@property (assign, nonatomic) NSInteger code;


// @xaoxuu: description
@property (copy, nonatomic) NSString *localizedDescription;
// @xaoxuu: reason
@property (copy, nonatomic) NSString *localizedFailureReason;
// @xaoxuu: LocalizedRecoverySuggestion
@property (copy, nonatomic) NSString *localizedRecoverySuggestion;
// @xaoxuu: localizedRecoveryOptions
@property (copy, nonatomic) NSMutableArray<NSString *> *localizedRecoveryOptions;

@end



评论