sorin | 7b865052 | 2016-11-02 18:23:41 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_ |
| 6 | #define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_ |
| 7 | |
| 8 | namespace update_client { |
| 9 | |
| 10 | // Errors generated as a result of calling UpdateClient member functions. |
| 11 | // These errors are not sent in pings. |
| 12 | enum class Error { |
| 13 | INVALID_ARGUMENT = -1, |
| 14 | NONE = 0, |
| 15 | UPDATE_IN_PROGRESS = 1, |
| 16 | UPDATE_CANCELED = 2, |
| 17 | RETRY_LATER = 3, |
| 18 | SERVICE_ERROR = 4, |
| 19 | UPDATE_CHECK_ERROR = 5, |
| 20 | }; |
| 21 | |
| 22 | // These errors are sent in pings. Add new values only to the bottom of |
| 23 | // the enums below; the order must be kept stable. |
| 24 | enum class ErrorCategory { |
| 25 | kErrorNone = 0, |
| 26 | kNetworkError, |
| 27 | kUnpackError, |
| 28 | kInstallError, |
| 29 | kServiceError, // Runtime errors which occur in the service itself. |
| 30 | }; |
| 31 | |
| 32 | // These errors are returned with the |kNetworkError| error category. This |
| 33 | // category could include other errors such as the errors defined by |
| 34 | // the Chrome net stack. |
| 35 | enum class CrxDownloaderError { |
| 36 | NONE = 0, |
| 37 | NO_URL = 10, |
| 38 | NO_HASH = 11, |
| 39 | BAD_HASH = 12, // The downloaded file fails the hash verification. |
| 40 | GENERIC_ERROR = -1 |
| 41 | }; |
| 42 | |
| 43 | // These errors are returned with the |kUnpackError| error category and |
sorin | 2892f721 | 2016-11-07 18:59:43 | [diff] [blame] | 44 | // indicate unpacker or patcher error. |
sorin | 7b865052 | 2016-11-02 18:23:41 | [diff] [blame] | 45 | enum class UnpackerError { |
| 46 | kNone = 0, |
sorin | 2892f721 | 2016-11-07 18:59:43 | [diff] [blame] | 47 | kInvalidParams = 1, |
| 48 | kInvalidFile = 2, |
| 49 | kUnzipPathError = 3, |
| 50 | kUnzipFailed = 4, |
| 51 | // kNoManifest = 5, // Deprecated. Never used. |
| 52 | kBadManifest = 6, |
| 53 | kBadExtension = 7, |
| 54 | kInvalidId = 8, |
| 55 | // kInstallerError = 9, // Deprecated. Don't use. |
| 56 | kIoError = 10, |
| 57 | kDeltaVerificationFailure = 11, |
| 58 | kDeltaBadCommands = 12, |
| 59 | kDeltaUnsupportedCommand = 13, |
| 60 | kDeltaOperationFailure = 14, |
| 61 | kDeltaPatchProcessFailure = 15, |
| 62 | kDeltaMissingExistingFile = 16, |
| 63 | // kFingerprintWriteFailed = 17, // Deprecated. Don't use. |
sorin | 7b865052 | 2016-11-02 18:23:41 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | // These errors are returned with the |kServiceError| error category and |
sorin | 2892f721 | 2016-11-07 18:59:43 | [diff] [blame] | 67 | // are returned by the component installers. |
| 68 | enum class InstallError { |
| 69 | NONE = 0, |
| 70 | FINGERPRINT_WRITE_FAILED = 2, |
| 71 | BAD_MANIFEST = 3, |
| 72 | GENERIC_ERROR = 9, // Matches kInstallerError for compatibility. |
| 73 | CUSTOM_ERROR_BASE = 100, // Specific installer errors go above this value. |
| 74 | }; |
| 75 | |
| 76 | // These errors are returned with the |kInstallError| error category and |
sorin | 7b865052 | 2016-11-02 18:23:41 | [diff] [blame] | 77 | // indicate critical or configuration errors in the update service. |
| 78 | enum class ServiceError { |
| 79 | NONE = 0, |
| 80 | SERVICE_WAIT_FAILED = 1, |
| 81 | UPDATE_DISABLED = 2, |
| 82 | }; |
| 83 | |
| 84 | } // namespace update_client |
| 85 | |
| 86 | #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_ |