From c8e7d7f427ba43a7949d53ed9e1d9cda20136753 Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Sun, 1 Nov 2020 11:01:03 +0000 Subject: [PATCH] Move promise rejection handler into later promise. Fix #74 --- .../src/extension-common/11-error-handlers-api.js | 2 +- ...-sync-pac-script-with-pac-provider-api.tmpl.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/11-error-handlers-api.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/11-error-handlers-api.js index a0a55dc..e180ca9 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/11-error-handlers-api.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/11-error-handlers-api.js @@ -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 { diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js index 9db2838..213f650 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js @@ -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, + ), ); };