Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix(gateway): catch stream2 error (#1243)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Yahya <ya7yaz@gmail.com>
  • Loading branch information
ya7ya authored and daviddias committed Mar 3, 2018
1 parent 420de91 commit 5b40b41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/http/gateway/resources/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ module.exports = {
// response.continue()
let filetypeChecked = false
let stream2 = new Stream.PassThrough({ highWaterMark: 1 })
stream2.on('error', (err) => {
log.error('stream2 err: ', err)
})

let response = reply(stream2).hold()

pull(
Expand Down

1 comment on commit 5b40b41

@victorb
Copy link
Member

@victorb victorb commented on 5b40b41 Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diasdavid I'm not sure this is the right way to fix this. If there is a error elsewhere, the daemon/gateway still crashes. Sure, this fixes this particular issue, but we still crash when there is uncaught errors...

Please sign in to comment.