mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-23 18:03:44 +03:00
Fix a bug thrown after waking pc up
Handle a case when all pac-script urls fwail
This commit is contained in:
parent
63f5e6fd08
commit
eb996931ae
|
@ -37,6 +37,7 @@
|
||||||
const timeouted = window.utils.timeouted;
|
const timeouted = window.utils.timeouted;
|
||||||
|
|
||||||
const clarifyThen = window.apis.errorsLib.clarifyThen;
|
const clarifyThen = window.apis.errorsLib.clarifyThen;
|
||||||
|
const clarify = window.apis.errorsLib.clarify;
|
||||||
const Warning = window.apis.errorsLib.Warning;
|
const Warning = window.apis.errorsLib.Warning;
|
||||||
|
|
||||||
const httpLib = window.apis.httpLib;
|
const httpLib = window.apis.httpLib;
|
||||||
|
@ -85,7 +86,7 @@
|
||||||
reject(clearErr);
|
reject(clearErr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
createPromise().then((actionResult) => setProxyAsync().then(() => resolve(actionResult)));
|
createPromise().then((actionResult) => setProxyAsync().then(() => resolve(actionResult)), reject);
|
||||||
}));
|
}));
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
@ -196,10 +197,14 @@
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Promise.reject(),
|
Promise.reject(),
|
||||||
|
).catch(
|
||||||
|
(err) => Promise.reject(clarify(
|
||||||
|
err,
|
||||||
|
chrome.i18n.getMessage('FailedToDownloadPacScriptFromAddresses') + ': [ '
|
||||||
|
+ provider.pacUrls.join(' , ') + ' ].',
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
);
|
).then(
|
||||||
|
|
||||||
pacDataPromise.then(
|
|
||||||
(pacData) => {
|
(pacData) => {
|
||||||
setPacAsync(
|
setPacAsync(
|
||||||
pacData,
|
pacData,
|
||||||
|
@ -209,11 +214,7 @@
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
clarifyThen(
|
cb,
|
||||||
chrome.i18n.getMessage('FailedToDownloadPacScriptFromAddresses') + ': [ '
|
|
||||||
+ provider.pacUrls.join(' , ') + ' ].',
|
|
||||||
cb,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -390,7 +391,6 @@
|
||||||
|
|
||||||
syncWithPacProviderAsync(
|
syncWithPacProviderAsync(
|
||||||
key = this.currentPacProvierKey, cb = throwIfError) {
|
key = this.currentPacProvierKey, cb = throwIfError) {
|
||||||
|
|
||||||
if( typeof(key) === 'function' ) {
|
if( typeof(key) === 'function' ) {
|
||||||
cb = key;
|
cb = key;
|
||||||
key = this.getCurrentPacProviderKey();
|
key = this.getCurrentPacProviderKey();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user