Skip to content

Commit c786df3

Browse files
committed
fix: dont emit error if aborted but complete
Work-around a nodejs/node#18756
1 parent c05f600 commit c786df3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ const pickDefined = (target, source, keys) => {
6262
};
6363

6464
function emitAbortedError() {
65-
this.emit("error", new Cancel("aborted"));
65+
// https://github.com/nodejs/node/issues/18756
66+
if (!this.complete) {
67+
this.emit("error", new Cancel("aborted"));
68+
}
6669
}
6770

6871
const isString = value => typeof value === "string";

0 commit comments

Comments
 (0)