mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-03-15 10:30:48 +00:00
Catch bugs in case of timeout on node or errors when no HTTP available
This commit is contained in:
parent
5d5732821f
commit
e0a38ab5ad
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user