Bug 618340: don't report network failure for unknown errors. r=philiKON
authorRichard Newman <rnewman@mozilla.com>
Fri, 10 Dec 2010 16:32:16 -0800
changeset 59095 d2f296b6504cfdfeaee060c85eac314f1e77bf8c
parent 59094 88a632f17a9e74739d3b0a710d79142aee28305d
child 59096 01d3e79cf7cb22e25843b498585b1d67e5e1bf41
child 59108 3608943f3475b2a39220ff1f637ed2d02f138013
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersphiliKON
bugs618340
Bug 618340: don't report network failure for unknown errors. r=philiKON
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -759,19 +759,21 @@ WeaveSvc.prototype = {
             this._log.warn("Got exception \"" + ex + "\" fetching cryptoKeys.");
             // TODO: Um, what exceptions might we get here? Should we re-throw any?
             
             // One kind of exception: HMAC failure.
             if (Utils.isHMACMismatch(ex)) {
               Status.login = LOGIN_FAILED_INVALID_PASSPHRASE;
               Status.sync = CREDENTIALS_CHANGED;
             }
-            else
-              // Assume that every other failure is network-related.
-              Status.login = LOGIN_FAILED_NETWORK_ERROR;
+            else {
+              // In the absence of further disambiguation or more precise
+              // failure constants, just report failure.
+              Status.login = LOGIN_FAILED;
+            }
             return false;
           }
         }
         else {
           this._log.info("... 'crypto' is not a reported collection. Generating new keys.");
         }
 
         if (!cryptoKeys) {