Move promise rejection handler into later promise. Fix #74

This commit is contained in:
ilyaigpetrov 2020-11-01 11:01:03 +00:00
parent 5287510263
commit c8e7d7f427
2 changed files with 8 additions and 9 deletions

View File

@ -282,7 +282,7 @@
handlers.mayNotify(
noCon,
chrome.i18n.getMessage('noControl'),
chrome.i18n.getMessage('which'),
chrome.i18n.getMessage('WhichQ'),
{icon: 'no-control-128.png', ifSticky: false}
);
} else {

View File

@ -190,18 +190,12 @@
() => new Promise(
(resolve, reject) => httpLib.get(
url,
(newErr, pacData) => newErr ? reject(newErr) : resolve(pacData),
(newErr, pacData) =>
newErr ? reject(newErr) : resolve(pacData),
),
),
),
Promise.reject(),
)
.catch(
clarifyThen(
chrome.i18n.getMessage('FailedToDownloadPacScriptFromAddresses') + ': [ '
+ provider.pacUrls.join(' , ') + ' ].',
cb,
),
),
);
@ -215,6 +209,11 @@
),
);
},
clarifyThen(
chrome.i18n.getMessage('FailedToDownloadPacScriptFromAddresses') + ': [ '
+ provider.pacUrls.join(' , ') + ' ].',
cb,
),
);
};