diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-10-24 14:13:44 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-10-24 14:13:44 +0200 |
commit | 768a1b94576f6a9da284fdb69b9fb1d3354c8f5d (patch) | |
tree | d6509c2c36084799a546257d0b8946014eb49e13 /services/sync/modules/resource.js | |
parent | 26412bcab4723d44bc0eb22d7c858e85a84910d5 (diff) | |
download | UXP-768a1b94576f6a9da284fdb69b9fb1d3354c8f5d.tar UXP-768a1b94576f6a9da284fdb69b9fb1d3354c8f5d.tar.gz UXP-768a1b94576f6a9da284fdb69b9fb1d3354c8f5d.tar.lz UXP-768a1b94576f6a9da284fdb69b9fb1d3354c8f5d.tar.xz UXP-768a1b94576f6a9da284fdb69b9fb1d3354c8f5d.zip |
Pass exceptions directly to logger.
Diffstat (limited to 'services/sync/modules/resource.js')
-rw-r--r-- | services/sync/modules/resource.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/services/sync/modules/resource.js b/services/sync/modules/resource.js index b31d129a5..a6c0739b6 100644 --- a/services/sync/modules/resource.js +++ b/services/sync/modules/resource.js @@ -231,7 +231,7 @@ AsyncResource.prototype = { channel.asyncOpen(listener, null); } catch (ex) { // asyncOpen can throw in a bunch of cases -- e.g., a forbidden port. - this._log.warn("Caught an error in asyncOpen: " + CommonUtils.exceptionStr(ex)); + this._log.warn("Caught an error in asyncOpen: ", ex); CommonUtils.nextTick(callback.bind(this, ex)); } }, @@ -278,8 +278,7 @@ AsyncResource.prototype = { } catch(ex) { // Got a response, but an exception occurred during processing. // This shouldn't occur. - this._log.warn("Caught unexpected exception " + CommonUtils.exceptionStr(ex) + - " in _onComplete."); + this._log.warn("Caught unexpected exception in _onComplete. ", ex); this._log.debug(CommonUtils.stackTrace(ex)); } @@ -318,8 +317,7 @@ AsyncResource.prototype = { contentLength + "."); } } catch (ex) { - this._log.debug("Caught exception " + CommonUtils.exceptionStr(ex) + - " visiting headers in _onComplete."); + this._log.debug("Caught exception visiting headers in _onComplete", ex); this._log.debug(CommonUtils.stackTrace(ex)); } @@ -335,7 +333,7 @@ AsyncResource.prototype = { try { return JSON.parse(ret); } catch (ex) { - this._log.warn("Got exception parsing response body: \"" + CommonUtils.exceptionStr(ex)); + this._log.warn("Got exception parsing response body", ex); // Stringify to avoid possibly printing non-printable characters. this._log.debug("Parse fail: Response body starts: \"" + JSON.stringify((ret + "").slice(0, 100)) + @@ -541,7 +539,7 @@ ChannelListener.prototype = { siStream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream); siStream.init(stream); } catch (ex) { - this._log.warn("Exception creating nsIScriptableInputStream." + CommonUtils.exceptionStr(ex)); + this._log.warn("Exception creating nsIScriptableInputStream", ex); this._log.debug("Parameters: " + req.URI.spec + ", " + stream + ", " + off + ", " + count); // Cannot proceed, so rethrow and allow the channel to cancel itself. throw ex; @@ -558,8 +556,7 @@ ChannelListener.prototype = { this._onProgress(); } catch (ex) { this._log.warn("Got exception calling onProgress handler during fetch of " - + req.URI.spec); - this._log.debug(CommonUtils.exceptionStr(ex)); + + req.URI.spec, ex); this._log.trace("Rethrowing; expect a failure code from the HTTP channel."); throw ex; } @@ -574,7 +571,7 @@ ChannelListener.prototype = { try { CommonUtils.namedTimer(this.abortRequest, this._timeout, this, "abortTimer"); } catch (ex) { - this._log.warn("Got exception extending abort timer: " + CommonUtils.exceptionStr(ex)); + this._log.warn("Got exception extending abort timer: ", ex); } }, @@ -668,7 +665,7 @@ ChannelNotificationListener.prototype = { } } } catch (ex) { - this._log.error("Error copying headers: " + CommonUtils.exceptionStr(ex)); + this._log.error("Error copying headers: ", ex); } // We let all redirects proceed. |