mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-03-15 02:20:50 +00:00
Just comments
This commit is contained in:
parent
6469a01cc7
commit
43efb3f7b2
@ -211,10 +211,12 @@ class TransportHTTP extends Transport {
|
||||
through = new stream.PassThrough();
|
||||
httptools.p_GET(this._url(url, servercommands.rawfetch), Object.assign({wantstream: true}, opts))
|
||||
.then(s => s.pipe(through))
|
||||
// Note any .catch is happening AFTER through returned
|
||||
.catch(err => {
|
||||
console.warn(this.name, "createReadStream caught error", err.message);
|
||||
if (typeof through.destroy === 'function') {
|
||||
through.destroy(err); // Will emit error & close and free up resources
|
||||
// caller MUST implimit through.on('error', err=>) or will generate uncaught error message
|
||||
} else {
|
||||
through.emit('error', err);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user