Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: remove non-reachable case
  • Loading branch information
d-goog committed Sep 6, 2023
commit 7939afd728fe4b2a1accdcafa04c9062b8604aa8
7 changes: 0 additions & 7 deletions src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3672,13 +3672,6 @@ class File extends ServiceObject<File, FileMetadata> {
} else {
pipeline(data, writable, err => {
if (err) {
// If data is not a valid PipelineSource, then pipeline will
// fail without destroying the writable stream. If data is a
// PipelineSource that yields invalid chunks (e.g. a stream in
// object mode or an iterable that does not yield Buffers or
// strings), then pipeline will destroy the writable stream.
if (!writable.destroyed) writable.destroy();
Comment on lines -3690 to -3695
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case doesn't happen - instead, Node throws immediately and this callback is never called.


if (typeof data !== 'function') {
// Only PipelineSourceFunction can be retried. Async-iterables
// and Readable streams can only be consumed once.
Expand Down