Skip to content

Commit

Permalink
fix: dont emit error if aborted but complete
Browse files Browse the repository at this point in the history
Work-around a nodejs/node#18756
  • Loading branch information
julien-f committed Feb 28, 2019
1 parent c05f600 commit c786df3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ const pickDefined = (target, source, keys) => {
};

function emitAbortedError() {
this.emit("error", new Cancel("aborted"));
// https://github.com/nodejs/node/issues/18756
if (!this.complete) {
this.emit("error", new Cancel("aborted"));
}
}

const isString = value => typeof value === "string";
Expand Down

0 comments on commit c786df3

Please sign in to comment.