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); return cb(pacErr, pacRes);
} }
const warns = pacWarns; const warns = pacWarns;
if (ipsErr || ipsWarns.length) { if (ipsErr) {
warns.push(...[ipsErr], ...ipsWarns); warns.push(ipsErr);
}
if (ipsWarns.length) {
console.log('PUSHING W:', ipsWarns); // TODO:
warns.push(...ipsWarns);
} }
this.pushToStorageAsync( this.pushToStorageAsync(
(pushErr) => cb(pacErr || pushErr, null, ...warns), (pushErr) => cb(pacErr || pushErr, null, ...warns),

View File

@ -215,6 +215,7 @@ 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,8 +268,14 @@ export default function getApp(theState) {
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);

View File

@ -151,6 +151,7 @@
([[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;
@ -160,6 +161,7 @@
} else { } else {
warns = [v6err]; warns = [v6err];
} }
console.log('ALL WARNS FOR IPS:', warns); // TODO:
cb(null, ips, ...warns); cb(null, ips, ...warns);
} }