Skip to content

Commit f1c5c10

Browse files
committed
fixuP
1 parent 37f31ad commit f1c5c10

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/internal/streams/readable.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,8 +1113,10 @@ async function* createAsyncIterator(stream, options) {
11131113
const chunk = stream.destroyed ? null : stream.read();
11141114
if (chunk !== null) {
11151115
yield chunk;
1116-
} else if (error !== undefined) {
1117-
break;
1116+
} else if (error) {
1117+
throw error;
1118+
} else if (error === null) {
1119+
return;
11181120
} else {
11191121
await new Promise(next);
11201122
}

0 commit comments

Comments
 (0)