Bug 725180 - Updater JS error handling for new error codes. r=rstrong
authorBrian R. Bondy <netzen@gmail.com>
Fri, 24 Feb 2012 16:29:42 -0500
changeset 87642 2b1a53905350f5f3a23bbd0810142e7efdb02204
parent 87641 4d9778e932ba92916975133f7288f7956915e189
child 87643 7cb1e4c50145ebc5f14d4749fa241e9c2dcbb0f6
push id22138
push userbbondy@mozilla.com
push dateFri, 24 Feb 2012 21:30:05 +0000
treeherdermozilla-central@2b1a53905350 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs725180
milestone13.0a1
first release with
nightly linux32
2b1a53905350 / 13.0a1 / 20120224163427 / files
nightly linux64
2b1a53905350 / 13.0a1 / 20120224163427 / files
nightly mac
2b1a53905350 / 13.0a1 / 20120224163427 / files
nightly win32
2b1a53905350 / 13.0a1 / 20120224163427 / files
nightly win64
2b1a53905350 / 13.0a1 / 20120224163427 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 725180 - Updater JS error handling for new error codes. r=rstrong
toolkit/mozapps/update/nsUpdateService.js
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -136,24 +136,35 @@ const STATE_APPLYING        = "applying"
 const STATE_SUCCEEDED       = "succeeded";
 const STATE_DOWNLOAD_FAILED = "download-failed";
 const STATE_FAILED          = "failed";
 
 // From updater/errors.h:
 const WRITE_ERROR        = 7;
 const UNEXPECTED_ERROR   = 8;
 const ELEVATION_CANCELED = 9;
+
+// Windows service specific errors
 const SERVICE_UPDATER_COULD_NOT_BE_STARTED = 16000;
 const SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS = 16001;
 const SERVICE_UPDATER_SIGN_ERROR           = 16002;
 const SERVICE_UPDATER_COMPARE_ERROR        = 16003;
 const SERVICE_UPDATER_IDENTITY_ERROR       = 16004;
 const SERVICE_STILL_APPLYING_ON_SUCCESS    = 16005;
 const SERVICE_STILL_APPLYING_ON_FAILURE    = 16006;
 
+// Updater MAR security errors
+const CERT_LOAD_ERROR                         = 17;
+const CERT_HANDLING_ERROR                     = 18;
+const CERT_VERIFY_ERROR                       = 19;
+const ARCHIVE_NOT_OPEN                        = 20;
+const COULD_NOT_READ_PRODUCT_INFO_BLOCK_ERROR = 21;
+const MAR_CHANNEL_MISMATCH_ERROR              = 22;
+const VERSION_DOWNGRADE_ERROR                 = 23;
+
 const CERT_ATTR_CHECK_FAILED_NO_UPDATE  = 100;
 const CERT_ATTR_CHECK_FAILED_HAS_UPDATE = 101;
 const BACKGROUNDCHECK_MULTIPLE_FAILURES = 110;
 
 const DOWNLOAD_CHUNK_SIZE           = 300000; // bytes
 const DOWNLOAD_BACKGROUND_INTERVAL  = 600;    // seconds
 const DOWNLOAD_FOREGROUND_INTERVAL  = 0;
 
@@ -1408,17 +1419,24 @@ UpdateService.prototype = {
         }
 
         if (update.errorCode == SERVICE_UPDATER_COULD_NOT_BE_STARTED ||
             update.errorCode == SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS ||
             update.errorCode == SERVICE_UPDATER_SIGN_ERROR ||
             update.errorCode == SERVICE_UPDATER_COMPARE_ERROR ||
             update.errorCode == SERVICE_UPDATER_IDENTITY_ERROR ||
             update.errorCode == SERVICE_STILL_APPLYING_ON_SUCCESS ||
-            update.errorCode == SERVICE_STILL_APPLYING_ON_FAILURE) {
+            update.errorCode == SERVICE_STILL_APPLYING_ON_FAILURE ||
+            update.errorCode == CERT_LOAD_ERROR ||
+            update.errorCode == CERT_HANDLING_ERROR ||
+            update.errorCode == CERT_VERIFY_ERROR ||
+            update.errorCode == ARCHIVE_NOT_OPEN ||
+            update.errorCode == COULD_NOT_READ_PRODUCT_INFO_BLOCK_ERROR ||
+            update.errorCode == MAR_CHANNEL_MISMATCH_ERROR ||
+            update.errorCode == VERSION_DOWNGRADE_ERROR) {
           var failCount = getPref("getIntPref", 
                                   PREF_APP_UPDATE_SERVICE_ERRORS, 0);
           var maxFail = getPref("getIntPref", 
                                 PREF_APP_UPDATE_SERVICE_MAX_ERRORS, 
                                 DEFAULT_SERVICE_MAX_ERRORS);
 
           // As a safety, when the service reaches maximum failures, it will
           // disable itself and fallback to using the normal update mechanism