Skip to content

Commit

Permalink
Handle ECONNRESET streaming errors
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Jul 28, 2016
1 parent b7d028a commit 6eeb884
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export class Exec extends Writable implements Exec {
this.process.stderr.on('error', this.emit.bind(this, 'error'))

this.process.stdin.on('error', (err: Error) => {
if (!parsed || (err as any).code !== 'EPIPE') {
const code = (err as any).code

if (!parsed || (code !== 'EPIPE' && code !== 'ECONNRESET')) {
this.emit('error', err)
}
})
Expand Down

0 comments on commit 6eeb884

Please sign in to comment.