mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2025-02-07 15:20:36 +03:00
Fix the bug with non-descriptive warnings. Make DNS errors non-critical
This commit is contained in:
parent
b77be60946
commit
93aa084de9
|
@ -492,7 +492,6 @@
|
||||||
warns.push(ipsErr);
|
warns.push(ipsErr);
|
||||||
}
|
}
|
||||||
if (ipsWarns.length) {
|
if (ipsWarns.length) {
|
||||||
console.log('PUSHING W:', ipsWarns); // TODO:
|
|
||||||
warns.push(...ipsWarns);
|
warns.push(...ipsWarns);
|
||||||
}
|
}
|
||||||
this.pushToStorageAsync(
|
this.pushToStorageAsync(
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
"message": "Error"
|
"message": "Error"
|
||||||
},
|
},
|
||||||
"Non_critical_error": {
|
"Non_critical_error": {
|
||||||
"message": "Non-critical error. Don't worry and go on"
|
"message": "Non-critical error. Don't worry: it works"
|
||||||
},
|
},
|
||||||
"Donate": {
|
"Donate": {
|
||||||
"message": "Donate"
|
"message": "Donate"
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
"message": "Ошибка"
|
"message": "Ошибка"
|
||||||
},
|
},
|
||||||
"Non_critical_error": {
|
"Non_critical_error": {
|
||||||
"message": "Некритичная ошибка. Всё хорошо, продолжайте работу"
|
"message": "Некритичная ошибка. Всё хорошо, продолжаем работу"
|
||||||
},
|
},
|
||||||
"Donate": {
|
"Donate": {
|
||||||
"message": "Поддержать"
|
"message": "Поддержать"
|
||||||
|
|
|
@ -215,7 +215,6 @@ export default function getApp(theState) {
|
||||||
|
|
||||||
let messageHtml = err ? errToHtmlMessage(err) : '';
|
let messageHtml = err ? errToHtmlMessage(err) : '';
|
||||||
|
|
||||||
console.log('WARNS:', warns); // TODO:
|
|
||||||
const warningHtml = warns
|
const warningHtml = warns
|
||||||
.filter((w) => w)
|
.filter((w) => w)
|
||||||
.map(
|
.map(
|
||||||
|
@ -267,15 +266,8 @@ export default function getApp(theState) {
|
||||||
this.setStatusTo(beforeStatus);
|
this.setStatusTo(beforeStatus);
|
||||||
this.switchInputs('off');
|
this.switchInputs('off');
|
||||||
operation((err, res, ...warns) => {
|
operation((err, res, ...warns) => {
|
||||||
|
|
||||||
if (warns.length && warns[0].length === 0) {
|
|
||||||
throw new Error('WWWWARNS'); // TODO:
|
|
||||||
}
|
|
||||||
console.log('W BEFORE:', warns); // TODO:
|
|
||||||
warns = warns.filter( (w) => w );
|
warns = warns.filter( (w) => w );
|
||||||
console.log('W AFTER:', warns); // TODO:
|
|
||||||
if (err || warns.length) {
|
if (err || warns.length) {
|
||||||
console.log('APP ERR, WARNS:', err, warns); // TODO:
|
|
||||||
this.showErrors(err, ...warns);
|
this.showErrors(err, ...warns);
|
||||||
} else {
|
} else {
|
||||||
this.setStatusTo(afterStatus);
|
this.setStatusTo(afterStatus);
|
||||||
|
|
|
@ -151,7 +151,6 @@
|
||||||
([[v4err, v4res], [v6err, v6res]]) => {
|
([[v4err, v4res], [v6err, v6res]]) => {
|
||||||
|
|
||||||
if(v4err) {
|
if(v4err) {
|
||||||
console.log('V4RES:', v4res); // TODO:
|
|
||||||
return cb(v4err, v4res);
|
return cb(v4err, v4res);
|
||||||
}
|
}
|
||||||
const ips = v4res;
|
const ips = v4res;
|
||||||
|
@ -161,7 +160,6 @@
|
||||||
} else {
|
} else {
|
||||||
warns = [v6err];
|
warns = [v6err];
|
||||||
}
|
}
|
||||||
console.log('ALL WARNS FOR IPS:', warns); // TODO:
|
|
||||||
cb(null, ips, ...warns);
|
cb(null, ips, ...warns);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -275,15 +273,16 @@
|
||||||
Promise.all( promises ).then( (cbsRes) => {
|
Promise.all( promises ).then( (cbsRes) => {
|
||||||
|
|
||||||
let ipErrors = cbsRes.map( ([err]) => err ).filter( (err) => err );
|
let ipErrors = cbsRes.map( ([err]) => err ).filter( (err) => err );
|
||||||
|
let warns = [];
|
||||||
if (ipErrors.length) {
|
if (ipErrors.length) {
|
||||||
ipErrors = clarify(
|
warns = [clarify(
|
||||||
ipErrors,
|
ipErrors,
|
||||||
'Не удалось получить один или несколько IP адресов для' +
|
'Не удалось получить один или несколько IP адресов для' +
|
||||||
' прокси-серверов. Иконка для уведомления об обходе' +
|
' прокси-серверов. Иконка для уведомления об обходе' +
|
||||||
' блокировок может не отображаться.'
|
' блокировок может не отображаться.'
|
||||||
);
|
)];
|
||||||
}
|
} else {}
|
||||||
cb(null, null, ipErrors);
|
cb(null, null, ...warns);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user