Catch bugs in case of timeout on node or errors when no HTTP available

This commit is contained in:
Mitra Ardron 2018-10-18 16:17:03 +13:00
parent 5d5732821f
commit e0a38ab5ad
2 changed files with 2 additions and 2 deletions

View File

@ -337,7 +337,7 @@ class Transports {
if (cb) { cb(null, s); } else { return(s); }; // Callback or resolve stream
})
.catch(err => {
if (err instanceof DTerrors.TransportError) {
if (err instanceof errors.TransportError) {
console.warn("Transports.createReadStream caught", err.message);
} else {
console.error("Transports.createReadStream caught", err);

View File

@ -45,7 +45,7 @@ async function loopfetch(req, ms, count, what) {
}
}
console.warn("loopfetch of",what,"failed");
if (loopguard !== (window && window.loopguard)) {
if (loopguard !== ((typeof window != "undefined") && window.loopguard)) {
debught("Looping exited because of page change %s", what);
throw new Error("Looping exited because of page change "+ what)
} else {