From e0a38ab5ad04a5a68c4f76cecaa1204cf4304d98 Mon Sep 17 00:00:00 2001 From: Mitra Ardron Date: Thu, 18 Oct 2018 16:17:03 +1300 Subject: [PATCH] Catch bugs in case of timeout on node or errors when no HTTP available --- Transports.js | 2 +- httptools.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Transports.js b/Transports.js index c28f60e..1d352d5 100644 --- a/Transports.js +++ b/Transports.js @@ -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); diff --git a/httptools.js b/httptools.js index 0cca3ca..86c3152 100644 --- a/httptools.js +++ b/httptools.js @@ -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 {