Bug 692386 - sync: Add missing requested URL on NS_ERROR_NET_RESET. r=markh draft
authorJeremy Lempereur <jeremy.lempereur@gmail.com>
Wed, 03 Jan 2018 12:59:03 +0100
changeset 715272 012bb9c322ecda93be32f43582492b37e407396d
parent 715271 ac93fdadf1022211eec62258ad22b42cb37a6d14
child 744748 933d537dc624f2b83d0d09d1385fee878b8701b7
push id94114
push userbmo:jeremy.lempereur@gmail.com
push dateWed, 03 Jan 2018 11:59:20 +0000
reviewersmarkh
bugs692386
milestone59.0a1
Bug 692386 - sync: Add missing requested URL on NS_ERROR_NET_RESET. r=markh The requested URL was logged on almost each failing request exception. Added a warn message to log the request method and url when any request fails. MozReview-Commit-ID: GKwd7HabTp6
services/sync/modules/resource.js
--- a/services/sync/modules/resource.js
+++ b/services/sync/modules/resource.js
@@ -166,16 +166,17 @@ Resource.prototype = {
       didTimeout = true;
       this._log.error(`Request timed out after ${this.ABORT_TIMEOUT}ms. Aborting.`);
       controller.abort();
     }, this.ABORT_TIMEOUT);
     let response;
     try {
       response = await responsePromise;
     } catch (e) {
+      this._log.warn(`${method} request to ${this.uri.spec} failed`, e);
       if (!didTimeout) {
         throw e;
       }
       throw Components.Exception("Request aborted (timeout)", Cr.NS_ERROR_NET_TIMEOUT);
     } finally {
       clearTimeout(timeoutId);
     }
     return this._processResponse(response, method);