Sparkle  2.0.0
A software update framework for macOS
SUErrors.h
1 //
2 // SUErrors.h
3 // Sparkle
4 //
5 // Created by C.W. Betts on 10/13/14.
6 // Copyright (c) 2014 Sparkle Project. All rights reserved.
7 //
8 
9 #ifndef SUERRORS_H
10 #define SUERRORS_H
11 
12 #if __has_feature(modules)
13 #if __has_warning("-Watimport-in-framework-header")
14 #pragma clang diagnostic ignored "-Watimport-in-framework-header"
15 #endif
16 @import Foundation;
17 #else
18 #import <Foundation/Foundation.h>
19 #endif
20 
21 #if defined(BUILDING_SPARKLE_TOOL) || defined(BUILDING_SPARKLE_TESTS)
22 // Ignore incorrect warning
23 #pragma clang diagnostic push
24 #pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
25 #import "SUExport.h"
26 #pragma clang diagnostic pop
27 #else
28 #import <Sparkle/SUExport.h>
29 #endif
30 
34 SU_EXPORT extern NSString *const SUSparkleErrorDomain;
35 
36 typedef NS_ENUM(OSStatus, SUError) {
37  // Configuration phase errors
38  SUNoPublicDSAFoundError = 0001,
39  SUInsufficientSigningError = 0002,
40  SUInsecureFeedURLError = 0003,
41  SUInvalidFeedURLError = 0004,
42  SUInvalidUpdaterError = 0005,
43  SUInvalidHostBundleIdentifierError = 0006,
44  SUInvalidHostVersionError = 0007,
45 
46  // Appcast phase errors.
47  SUAppcastParseError = 1000,
48  SUNoUpdateError = 1001,
49  SUAppcastError = 1002,
50  SURunningFromDiskImageError = 1003,
51  SUResumeAppcastError = 1004,
52  SURunningTranslocated = 1005,
53  SUWebKitTerminationError = 1006,
54 
55  // Download phase errors.
56  SUTemporaryDirectoryError = 2000,
57  SUDownloadError = 2001,
58 
59  // Extraction phase errors.
60  SUUnarchivingError = 3000,
61  SUSignatureError = 3001,
62  SUValidationError = 3002,
63 
64  // Installation phase errors.
65  SUFileCopyFailure = 4000,
66  SUAuthenticationFailure = 4001,
67  SUMissingUpdateError = 4002,
68  SUMissingInstallerToolError = 4003,
69  SURelaunchError = 4004,
70  SUInstallationError = 4005,
71  SUDowngradeError = 4006,
72  SUInstallationCanceledError = 4007,
73  SUInstallationAuthorizeLaterError = 4008,
74  SUNotAllowedInteractionError = 4009,
75  SUAgentInvalidationError = 4010,
76 
77  // API misuse errors.
78  SUIncorrectAPIUsageError = 5000
79 };
80 
81 typedef NS_ENUM(OSStatus, SPUNoUpdateFoundReason) {
82  SPUNoUpdateFoundReasonUnknown,
83  SPUNoUpdateFoundReasonOnLatestVersion,
84  SPUNoUpdateFoundReasonOnNewerThanLatestVersion,
85  SPUNoUpdateFoundReasonSystemIsTooOld,
86  SPUNoUpdateFoundReasonSystemIsTooNew
87 };
88 
89 SU_EXPORT extern NSString *const SPUNoUpdateFoundReasonKey;
90 SU_EXPORT extern NSString *const SPULatestAppcastItemFoundKey;
91 SU_EXPORT extern NSString *const SPUNoUpdateFoundUserInitiatedKey;
92 
93 #endif