File: update_client_errors.h

package info (click to toggle)
chromium 138.0.7204.157-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,071,864 kB
  • sloc: cpp: 34,936,859; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,967; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (166 lines) | stat: -rw-r--r-- 5,299 bytes parent folder | download | duplicates (3)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_
#define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_

namespace update_client {

// Errors generated as a result of calling UpdateClient member functions.
// These errors are not sent in pings.
enum class Error {
  NONE = 0,
  UPDATE_IN_PROGRESS = 1,
  UPDATE_CANCELED = 2,
  RETRY_LATER = 3,
  SERVICE_ERROR = 4,
  UPDATE_CHECK_ERROR = 5,
  CRX_NOT_FOUND = 6,
  INVALID_ARGUMENT = 7,
  BAD_CRX_DATA_CALLBACK = 8,
  MAX_VALUE,
};

// These errors are sent in pings. Add new values only to the bottom of
// the enums below; the order must be kept stable.
enum class ErrorCategory {
  kNone = 0,
  kDownload = 1,
  kUnpack = 2,
  kInstall = 3,
  kService = 4,  // Runtime errors which occur in the service itself.
  kUpdateCheck = 5,
  // kUnknown = 6, defined in `updater_service.mojom`.
  kInstaller = 7,
};

// These errors are returned with the `kDownload` error category. This category
// could include other errors such as the errors defined by the Chrome net
// stack.
enum class CrxDownloaderError {
  NONE = 0,
  NO_URL = 10,
  NO_HASH = 11,
  BAD_HASH = 12,  // The downloaded file fails the hash verification.
  DISK_FULL = 13,
  CANCELLED = 14,
  NO_DOWNLOAD_DIR = 15,

  // The Windows BITS queue contains to many update client jobs. The value is
  // chosen so that it can be reported as a custom COM error on this platform.
  BITS_TOO_MANY_JOBS = 0x0200,
  // Errors 11XX are reserved for Mac background downloader errors.
  MAC_BG_CANNOT_CREATE_DOWNLOAD_CACHE = 1101,
  MAC_BG_MOVE_TO_CACHE_FAIL = 1102,
  MAC_BG_MISSING_COMPLETION_DATA = 1103,
  MAC_BG_DUPLICATE_DOWNLOAD = 1104,
  MAC_BG_SESSION_INVALIDATED = 1105,
  MAC_BG_SESSION_TOO_MANY_TASKS = 1106,
  GENERIC_ERROR = -1
};

// These errors are returned with the |kUnpack| error category and
// indicate unpacker or patcher error.
enum class UnpackerError {
  kNone = 0,
  kInvalidParams = 1,
  kInvalidFile = 2,
  kUnzipPathError = 3,
  kUnzipFailed = 4,
  // kNoManifest = 5,         // Deprecated. Never used.
  kBadManifest = 6,
  kBadExtension = 7,
  // kInvalidId = 8,          // Deprecated. Combined with kInvalidFile.
  // kInstallerError = 9,     // Deprecated. Don't use.
  kIoError = 10,
  kDeltaVerificationFailure = 11,
  kDeltaBadCommands = 12,
  kDeltaUnsupportedCommand = 13,
  kDeltaOperationFailure = 14,
  kDeltaPatchProcessFailure = 15,
  kDeltaMissingExistingFile = 16,
  // kFingerprintWriteFailed = 17,    // Deprecated. Don't use.
  kPuffinMissingPreviousCrx = 18,
  kFailedToAddToCache = 19,
  kFailedToCreateCacheDir = 20,
  kCrxCacheNotProvided = 21,
  kCrxCacheMetadataCorrupted = 22,
  kCrxCacheFileNotCached = 23,
  kPatchInvalidOldFile = 24,
  kPatchInvalidPatchFile = 25,
  kPatchInvalidNewFile = 26,
  kXzFailed = 27,
  kPatchOutHashMismatch = 28,
};

// These errors are returned with the |kInstall| error category and
// are returned by the component installers.
enum class InstallError {
  NONE = 0,
  FINGERPRINT_WRITE_FAILED = 2,
  BAD_MANIFEST = 3,
  GENERIC_ERROR = 9,  // Matches kInstallerError for compatibility.
  MOVE_FILES_ERROR = 10,
  SET_PERMISSIONS_FAILED = 11,
  INVALID_VERSION = 12,
  VERSION_NOT_UPGRADED = 13,
  NO_DIR_COMPONENT_USER = 14,
  CLEAN_INSTALL_DIR_FAILED = 15,
  INSTALL_VERIFICATION_FAILED = 16,
  MISSING_INSTALL_PARAMS = 17,
  // If LaunchProcess is attempted on unsupported non-desktop skus e.g. xbox
  LAUNCH_PROCESS_FAILED = 18,
  CUSTOM_ERROR_BASE = 100,  // Specific installer errors go above this value.
};

// These errors are returned with the |kService| error category and
// indicate critical or configuration errors in the update service.
enum class ServiceError {
  NONE = 0,
  SERVICE_WAIT_FAILED = 1,
  UPDATE_DISABLED = 2,
  CANCELLED = 3,

  // Returned when a `CheckForUpdate` call is made, the server returns a
  // update response indicating an update is available, and updates are enabled.
  CHECK_FOR_UPDATE_ONLY = 4,
};

// These errors are related to serialization, deserialization, and parsing of
// protocol requests.
// The begin value for this enum is chosen not to conflict with network errors
// defined by net/base/net_error_list.h. The callers don't have to handle this
// error in any meaningful way, but this value may be reported in UMA stats,
// therefore avoiding collisions with known network errors is desirable.
enum class ProtocolError : int {
  NONE = 0,
  RESPONSE_NOT_TRUSTED = -10000,
  // Obsolete: MISSING_PUBLIC_KEY = -10001,
  MISSING_URLS = -10002,
  PARSE_FAILED = -10003,
  UPDATE_RESPONSE_NOT_FOUND = -10004,
  URL_FETCHER_FAILED = -10005,
  UNKNOWN_APPLICATION = -10006,
  RESTRICTED_APPLICATION = -10007,
  INVALID_APPID = -10008,
  OS_NOT_SUPPORTED = -10009,
  HW_NOT_SUPPORTED = -10010,
  NO_HASH = -10011,
  UNSUPPORTED_PROTOCOL = -10012,
  INTERNAL = -10013,
  UNSUPPORTED_OPERATION = -10014,
  INEXPRESSIBLE = -10015,
  UNKNOWN_ERROR = -10016,
  INVALID_OPERATION_ATTRIBUTES = -10017,
};

struct CategorizedError {
  ErrorCategory category = ErrorCategory::kNone;
  int code = 0;
  int extra = 0;
};

}  // namespace update_client

#endif  // COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_