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( handlers.mayNotify(
noCon, noCon,
chrome.i18n.getMessage('noControl'), chrome.i18n.getMessage('noControl'),
chrome.i18n.getMessage('which'), chrome.i18n.getMessage('WhichQ'),
{icon: 'no-control-128.png', ifSticky: false} {icon: 'no-control-128.png', ifSticky: false}
); );
} else { } else {

View File

@ -190,18 +190,12 @@
() => new Promise( () => new Promise(
(resolve, reject) => httpLib.get( (resolve, reject) => httpLib.get(
url, url,
(newErr, pacData) => newErr ? reject(newErr) : resolve(pacData), (newErr, pacData) =>
newErr ? reject(newErr) : resolve(pacData),
), ),
), ),
), ),
Promise.reject(), 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,
),
); );
}; };