зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1024812 - unhandled exceptions in hawkclient no longer cause sync to hang. r=rnewman
This commit is contained in:
Родитель
149910a91a
Коммит
79bf688cfb
|
@ -188,7 +188,7 @@ this.HawkClient.prototype = {
|
|||
let uri = this.host + path;
|
||||
let self = this;
|
||||
|
||||
function onComplete(error) {
|
||||
function _onComplete(error) {
|
||||
let restResponse = this.response;
|
||||
let status = restResponse.status;
|
||||
|
||||
|
@ -243,6 +243,18 @@ this.HawkClient.prototype = {
|
|||
deferred.resolve(this.response.body);
|
||||
};
|
||||
|
||||
function onComplete(error) {
|
||||
try {
|
||||
// |this| is the RESTRequest object and we need to ensure _onComplete
|
||||
// gets the same one.
|
||||
_onComplete.call(this, error);
|
||||
} catch (ex) {
|
||||
log.error("Unhandled exception processing response:" +
|
||||
CommonUtils.exceptionStr(ex));
|
||||
deferred.reject(ex);
|
||||
}
|
||||
}
|
||||
|
||||
let extra = {
|
||||
now: this.now(),
|
||||
localtimeOffsetMsec: this.localtimeOffsetMsec,
|
||||
|
|
Загрузка…
Ссылка в новой задаче