Skip to content

Commit

Permalink
fixup: always use destroy(err) instead of emit
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishrock123 committed Sep 23, 2019
1 parent 7e2ec35 commit bd6a3d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions helpers/readable-sink.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ReadableSink extends Readable {
if (error !== null) {
if (this[kErrored] === false) {
this[kErrored] = true
process.nextTick(_ => this.emit('error', error))
this.destory(error)
}
return
}
Expand All @@ -111,7 +111,7 @@ class ReadableSink extends Readable {

// If we get to here something is very wrong.
error = new Error(`ReadableSink: Invalid status without an error: ${status}`)
process.nextTick(_ => this.emit('error', error))
this.destory(error)
}
}

Expand Down
2 changes: 1 addition & 1 deletion helpers/writable-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class WritableSource extends Writable {
if (this[kFinalCallback] === null) {
// _write should not have happened.
const error = new Error('write happened but stream was ended without a final callback')
process.nextTick(_ => this.emit('error', error))
this.destory(error)
}
return
}
Expand Down

0 comments on commit bd6a3d1

Please sign in to comment.