forked from jerrykrinock/CategoriesObjC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NSError+LowLevel.h
36 lines (28 loc) · 1.19 KB
/
NSError+LowLevel.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
#import <Cocoa/Cocoa.h>
extern NSString* const SSYAppleScriptErrorDomain ;
@interface NSError (LowLevel)
/*!
@brief Given a Mac OS X system error code, tries to return
an error with one of the Mac OS X system domains and
localized description.
@details If you give it a known combination of domain and code,
and nil userInfo, -[NSError errorWithDomain:code:userInfo:] will
sometimes fill in the localized description, at least for errors
in NSOSStatusErrorDomain and NSMachErrorDomain. This method
tries to use that capability, but I need more documentation to
make it work better.
@param code An error code returned by a system function
*/
+ (NSError*)errorWithMacErrorCode:(NSInteger) code ;
/*!
@brief Given a POSIX error code, such as errno, returns
an error with NSPOSIXErrorDomain and maybe a
localized description.
@details Uses +errorWithMacErrorCode: under the hood.
@param code An error code returned by a system function
*/
+ (NSError*)errorWithPosixErrorCode:(NSInteger)code ;
+ (NSError*)errorWithHTTPStatusCode:(int)code
prettyFunction:(const char*)prettyFunction ;
+ (NSError*)errorWithAppleScriptErrorDictionary:(NSDictionary*)dic ;
@end