Trying to trace bug with non-descriptive warnings

This commit is contained in:
ilyaigpetrov 2021-09-12 07:41:15 +00:00
parent 1aec32de3e
commit b77be60946
3 changed files with 15 additions and 2 deletions

View File

@ -488,8 +488,12 @@
return cb(pacErr, pacRes);
}
const warns = pacWarns;
if (ipsErr || ipsWarns.length) {
warns.push(...[ipsErr], ...ipsWarns);
if (ipsErr) {
warns.push(ipsErr);
}
if (ipsWarns.length) {
console.log('PUSHING W:', ipsWarns); // TODO:
warns.push(...ipsWarns);
}
this.pushToStorageAsync(
(pushErr) => cb(pacErr || pushErr, null, ...warns),

View File

@ -215,6 +215,7 @@ export default function getApp(theState) {
let messageHtml = err ? errToHtmlMessage(err) : '';
console.log('WARNS:', warns); // TODO:
const warningHtml = warns
.filter((w) => w)
.map(
@ -267,8 +268,14 @@ export default function getApp(theState) {
this.switchInputs('off');
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 );
console.log('W AFTER:', warns); // TODO:
if (err || warns.length) {
console.log('APP ERR, WARNS:', err, warns); // TODO:
this.showErrors(err, ...warns);
} else {
this.setStatusTo(afterStatus);

View File

@ -151,6 +151,7 @@
([[v4err, v4res], [v6err, v6res]]) => {
if(v4err) {
console.log('V4RES:', v4res); // TODO:
return cb(v4err, v4res);
}
const ips = v4res;
@ -160,6 +161,7 @@
} else {
warns = [v6err];
}
console.log('ALL WARNS FOR IPS:', warns); // TODO:
cb(null, ips, ...warns);
}