-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathPBErrors.h
72 lines (63 loc) · 2.13 KB
/
PBErrors.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
69
70
71
72
//
// PBErrors.h
// PebbleSDK
//
// Created by Martijn The on 7/26/12.
// Copyright (c) 2012 Pebble Technology. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <PebbleKit-Static/PBDefines.h>
NS_ASSUME_NONNULL_BEGIN
PB_EXTERN NSString *PBErrorDomain;
/**
* PebbleKit Error codes.
* Inspect the localizedDescription of any NSError objects for a description.
*/
typedef NS_ENUM(NSInteger, PBErrorCode) {
PBErrorCodeNoSupportedProtocolsInInfoPlist,
PBErrorCodeErrorCreatingSession,
PBErrorCodeOutputStreamError,
PBErrorCodeInputStreamError,
PBErrorCodeSendMessageTimeout,
PBErrorCodeEndpointDisallowed,
PBErrorCodeVersionInfoTimeout,
PBErrorCodeCannotCreateSessionWhileClosing,
PBErrorCodeNoAppUUID,
PBErrorCodeAppMessageRejected,
PBErrorCodeAppMessageAckTimeout,
PBErrorCodeDictionaryUnsupportedKeyClass,
PBErrorCodeDictionaryUnsupportedValueClass,
PBErrorCodeDictionaryInternalConsistency,
PBErrorCodeInvalidArguments,
PBErrorCodePebbleAppUnreachable,
PBErrorCodePebbleAppRequestTimeout,
PBErrorCodePebbleAppEmptyResponse,
PBErrorCodePebbleAppUnexpectedResponse,
PBErrorCodeServerNotAvailable,
PBErrorCodeDownloadFailed,
PBErrorCodePebbleNotConnected,
PBErrorCodeMessageTooLong,
PBErrorCodeBluetoothDisabled,
PBErrorCodeBluetoothLowEnergyHandshakeFailed,
PBErrorCodeFirmwareUpdateMetadataInvalid,
PBErrorCodeBluetoothLowEnergyFailedToConnect,
PBErrorCodeBluetoothLowEnergyUnfaithful,
PBErrorCodeTransportClosedError,
PBErrorCodeStreamInternalError,
};
@interface NSError (Pebble)
/**
* Convenience method to create an NSError object with <PBErrorDomain> error domain
* and a given PBErrorCode and with an underlying NSError object.
* @param code The error code for which to create the error
* @param error The underlying error
*/
+ (NSError*)pebbleErrorWithCode:(PBErrorCode)code underLyingError:(NSError * __nullable)error;
/**
* Convenience method to create an NSError object with <PBErrorDomain> error domain
* and a given PBErrorCode.
* @param code The error code for which to create the error
*/
+ (NSError*)pebbleErrorWithCode:(PBErrorCode)code;
@end
NS_ASSUME_NONNULL_END