Skip to content

Commit

Permalink
fix(tarball): catch errors thrown from stream handler
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Mar 1, 2018
1 parent c9d17a9 commit bdd6628
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/with-tarball-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ function withTarballStream (spec, opts, streamHandler) {
opts.integrity = i
})
}
tardata.once('error', err => tardata.on('newListener', (ev, l) => {
if (ev === 'error') { l(err) }
}))
return streamHandler(tardata)
tardata.on('error', err => console.error('ERROR:', err))
return BB.try(() => streamHandler(tardata))
.catch(err => {
// Retry once if we have a cache, to clear up any weird conditions.
// Don't retry network errors, though -- make-fetch-happen has already
Expand Down

0 comments on commit bdd6628

Please sign in to comment.