Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Check if it's caught by `stream.pipeline(...)`
if (!isFinished) {
return;
}
// We need to let `TimedOutTimeoutError` through, because `stream.pipeline(…)` aborts the request automatically.
if (isAborted() && !(error instanceof TimedOutTimeoutError)) {
return;
}
}
onError(error);
});
try {
timer(request);
timedOut(request, options.timeout, options.url);
emitter.emit('request', request);
const uploadStream = createProgressStream('uploadProgress', emitter, httpOptions.headers!['content-length'] as string);
isPiped = true;
await pipeline(
httpOptions.body!,
uploadStream,
request
);
request.emit('upload-complete');
} catch (error) {