Answer the question
In order to leave comments, you need to log in
Does Stream.pipeline always return [ERR_STREAM_PREMATURE_CLOSE]?
Hello. Don't tell me?
*stream.pipeline* always returns Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close . Although the stream threw an exception new Error('destroy') .
In a real application, a large file is being downloaded, sometimes the server drops the connection by timeout, and when using stream.pipeline, it is not clear what error occurred, ERR_STREAM_PREMATURE_CLOSE is always returned.
Node.js: 15.5.0
Platform: Ubuntu 20.10 x64
/* eslint-disable */
import http from 'https';
import { createWriteStream } from 'fs';
import { pipeline } from 'stream/promises';
const httpRequest = url => new Promise(resolve => http.get(url, res => resolve(res)));
const FILENAME_TMP = './1.tmp'
const linkFile = 'https://nodejs.org/dist/v15.5.0/node-v15.5.0-linux-x64.tar.xz';
const downloadStream = await httpRequest(linkFile, { responseType: 'stream' });
// view error
downloadStream.on('error', err => console.log('onError', err));
// break download
setTimeout(() => downloadStream.destroy(new Error('destroy')), 1000);
try {
await pipeline(
downloadStream,
createWriteStream(FILENAME_TMP)
);
console.log('Done');
} catch (err) {
console.log('onPipeline', err);
}
onError Error: destroy
at Timeout._onTimeout (file:///home/user/Project/ufopParser/3.js:17:41)
at listOnTimeout (node:internal/timers:556:17)
at processTimers (node:internal/timers:499:7)
onPipeline Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
at new NodeError (node:internal/errors:278:15)
at IncomingMessage.onclose (node:internal/streams/end-of-stream:117:38)
at IncomingMessage.emit (node:events:376:20)
at IncomingMessage._destroy (node:_http_incoming:169:10)
at _destroy (node:internal/streams/destroy:67:23)
at IncomingMessage.destroy (node:internal/streams/destroy:59:5)
at Timeout._onTimeout (file:///home/user/Project/ufopParser/3.js:17:33)
at listOnTimeout (node:internal/timers:556:17)
at processTimers (node:internal/timers:499:7) {
code: 'ERR_STREAM_PREMATURE_CLOSE'
}
Answer the question
In order to leave comments, you need to log in
kenwheeler.github.io/slick
Center Mode
arrows: false
controls: false
And I don't understand why you don't like it.
But judging by the description, you just don't cook it that way.
Resolved via CSS override.
the convenience of this carousel is a big question! I always use the owl carousel for the carousel. for all my tasks it has always been suitable.
The central block is scaled up by transform scale, which takes relative values as values, not exact ones. As a result, the central unit has an error, albeit not a significant one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question