update_client_errors.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_
  5. #define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_
  6. namespace update_client {
  7. // Errors generated as a result of calling UpdateClient member functions.
  8. // These errors are not sent in pings.
  9. enum class Error {
  10. NONE = 0,
  11. UPDATE_IN_PROGRESS = 1,
  12. UPDATE_CANCELED = 2,
  13. RETRY_LATER = 3,
  14. SERVICE_ERROR = 4,
  15. UPDATE_CHECK_ERROR = 5,
  16. CRX_NOT_FOUND = 6,
  17. INVALID_ARGUMENT = 7,
  18. BAD_CRX_DATA_CALLBACK = 8,
  19. MAX_VALUE,
  20. };
  21. // These errors are sent in pings. Add new values only to the bottom of
  22. // the enums below; the order must be kept stable.
  23. enum class ErrorCategory {
  24. kNone = 0,
  25. kDownload,
  26. kUnpack,
  27. kInstall,
  28. kService, // Runtime errors which occur in the service itself.
  29. kUpdateCheck,
  30. };
  31. // These errors are returned with the |kNetworkError| error category. This
  32. // category could include other errors such as the errors defined by
  33. // the Chrome net stack.
  34. enum class CrxDownloaderError {
  35. NONE = 0,
  36. NO_URL = 10,
  37. NO_HASH = 11,
  38. BAD_HASH = 12, // The downloaded file fails the hash verification.
  39. // The Windows BITS queue contains to many update client jobs. The value is
  40. // chosen so that it can be reported as a custom COM error on this platform.
  41. BITS_TOO_MANY_JOBS = 0x0200,
  42. GENERIC_ERROR = -1
  43. };
  44. // These errors are returned with the |kUnpack| error category and
  45. // indicate unpacker or patcher error.
  46. enum class UnpackerError {
  47. kNone = 0,
  48. kInvalidParams = 1,
  49. kInvalidFile = 2,
  50. kUnzipPathError = 3,
  51. kUnzipFailed = 4,
  52. // kNoManifest = 5, // Deprecated. Never used.
  53. kBadManifest = 6,
  54. kBadExtension = 7,
  55. // kInvalidId = 8, // Deprecated. Combined with kInvalidFile.
  56. // kInstallerError = 9, // Deprecated. Don't use.
  57. kIoError = 10,
  58. kDeltaVerificationFailure = 11,
  59. kDeltaBadCommands = 12,
  60. kDeltaUnsupportedCommand = 13,
  61. kDeltaOperationFailure = 14,
  62. kDeltaPatchProcessFailure = 15,
  63. kDeltaMissingExistingFile = 16,
  64. // kFingerprintWriteFailed = 17, // Deprecated. Don't use.
  65. };
  66. // These errors are returned with the |kInstall| error category and
  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. MOVE_FILES_ERROR = 10,
  74. SET_PERMISSIONS_FAILED = 11,
  75. INVALID_VERSION = 12,
  76. VERSION_NOT_UPGRADED = 13,
  77. NO_DIR_COMPONENT_USER = 14,
  78. CLEAN_INSTALL_DIR_FAILED = 15,
  79. INSTALL_VERIFICATION_FAILED = 16,
  80. MISSING_INSTALL_PARAMS = 17,
  81. // If LaunchProcess is attempted on unsupported non-desktop skus e.g. xbox
  82. LAUNCH_PROCESS_FAILED = 18,
  83. CUSTOM_ERROR_BASE = 100, // Specific installer errors go above this value.
  84. };
  85. // These errors are returned with the |kService| error category and
  86. // indicate critical or configuration errors in the update service.
  87. enum class ServiceError {
  88. NONE = 0,
  89. SERVICE_WAIT_FAILED = 1,
  90. UPDATE_DISABLED = 2,
  91. CANCELLED = 3,
  92. };
  93. // These errors are related to serialization, deserialization, and parsing of
  94. // protocol requests.
  95. // The begin value for this enum is chosen not to conflict with network errors
  96. // defined by net/base/net_error_list.h. The callers don't have to handle this
  97. // error in any meaningful way, but this value may be reported in UMA stats,
  98. // therefore avoiding collisions with known network errors is desirable.
  99. enum class ProtocolError : int {
  100. NONE = 0,
  101. RESPONSE_NOT_TRUSTED = -10000,
  102. MISSING_PUBLIC_KEY = -10001,
  103. MISSING_URLS = -10002,
  104. PARSE_FAILED = -10003,
  105. UPDATE_RESPONSE_NOT_FOUND = -10004,
  106. URL_FETCHER_FAILED = -10005,
  107. UNKNOWN_APPLICATION = -10006,
  108. RESTRICTED_APPLICATION = -10007,
  109. INVALID_APPID = -10008,
  110. };
  111. } // namespace update_client
  112. #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_ERRORS_H_