mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-03-16 02:40:49 +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
|
if (cb) { cb(null, s); } else { return(s); }; // Callback or resolve stream
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (err instanceof DTerrors.TransportError) {
|
if (err instanceof errors.TransportError) {
|
||||||
console.warn("Transports.createReadStream caught", err.message);
|
console.warn("Transports.createReadStream caught", err.message);
|
||||||
} else {
|
} else {
|
||||||
console.error("Transports.createReadStream caught", err);
|
console.error("Transports.createReadStream caught", err);
|
||||||
|
@ -45,7 +45,7 @@ async function loopfetch(req, ms, count, what) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.warn("loopfetch of",what,"failed");
|
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);
|
debught("Looping exited because of page change %s", what);
|
||||||
throw new Error("Looping exited because of page change "+ what)
|
throw new Error("Looping exited because of page change "+ what)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user