forked from jerrykrinock/CategoriesObjC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNSError+SSYInfo.h
68 lines (57 loc) · 2.4 KB
/
NSError+SSYInfo.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#import <Foundation/Foundation.h>
@interface NSError (SSYInfo)
/*!
@brief Adds an invocation which can be retrieved by -didRecoverInvocation to the receiver's userInfo
and returns an autoreleased copy of the receiver, unless the parameter is nil, then returns the receiver.
@details This can be used to encapsulate in the error an invocation which you can invoke after
a successful recovery occurs.
*/
- (NSError*)errorByAddingDidRecoverInvocation:(NSInvocation*)didRecoverInvocation ;
/*!
@brief Returns the invocation which was added to the receiver's userInfo by
-errorByAddingDidRecoverInvocation:, or nil if no such invocation has been added.
*/
- (NSInvocation*)didRecoverInvocation ;
/*!
@brief Adds a special key/value pair to the userInfo of a copy of
the receiver and returns the copy, unless the parameter is nil, then returns the
receiver. The special key/value pair causes
the returned error to return NO when sent -shouldShowSupportEmailButton.
*/
- (NSError*)errorByAddingDontShowSupportEmailButton ;
/*!
@brief Returns NO if the receiver has the special key/value pair added by
-errorByAddingDontShowSupportEmailButton. Otherwise, returns YES.
*/
- (BOOL)shouldShowSupportEmailButton ;
/*!
@brief Adds a special key/value pair to the userInfo of a copy of
the receiver and returns the copy, unless the parameter is nil, then returns
the receiver. The special key/value pair causes
the returned error to return YES when sent -isOnlyInformational.
*/
- (NSError*)errorByAddingIsOnlyInformational ;
/*!
@brief Returns YES if the receiver has the special key/value pair added by
-errorByAddingIsOnlyInformational. Otherwise, returns NO.
*/
- (BOOL)isOnlyInformational ;
/*!
@brief Adds a "Backtrace" key to the userInfo of a copy of
the receiver and returns the copy. The value of the key is
the current stack backtrace, provided by SSYDebugBacktrace().
*/
- (NSError*)errorByAddingBacktrace ;
/*!
@brief Adds a special key/value pair to the userInfo of a copy of
the receiver and returns the copy, unless the parameter is nil, then returns
the receiver. The special key/value pair causes
the returned error to return YES when sent -isLogged.
*/
- (NSError*)errorByAddingIsLogged ;
/*!
@brief Returns YES if the receiver has the special key/value pair added by
-errorByAddingIsLogged Otherwise, returns NO.
*/
- (BOOL)isLogged ;
@end