diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-01-28 06:17:12 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2017-01-28 06:17:12 +0800 |
commit | a8ed780d9b3659474c59c7856ab2ee1430c17b42 (patch) | |
tree | cff1a4b3b8f6d12836667d1fcab31e7e9319d60e /app/scripts/lib | |
parent | 451845142ed40d1e10bd993cedca1b28e59baba1 (diff) | |
parent | 61528bdf088e304150698d95218806d7b4faa56e (diff) | |
download | tangerine-wallet-browser-a8ed780d9b3659474c59c7856ab2ee1430c17b42.tar tangerine-wallet-browser-a8ed780d9b3659474c59c7856ab2ee1430c17b42.tar.gz tangerine-wallet-browser-a8ed780d9b3659474c59c7856ab2ee1430c17b42.tar.bz2 tangerine-wallet-browser-a8ed780d9b3659474c59c7856ab2ee1430c17b42.tar.lz tangerine-wallet-browser-a8ed780d9b3659474c59c7856ab2ee1430c17b42.tar.xz tangerine-wallet-browser-a8ed780d9b3659474c59c7856ab2ee1430c17b42.tar.zst tangerine-wallet-browser-a8ed780d9b3659474c59c7856ab2ee1430c17b42.zip |
Merge branch 'dev' into messageManagerCleanUp
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/stream-utils.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/scripts/lib/stream-utils.js b/app/scripts/lib/stream-utils.js index 1b7b89d14..ba79990cc 100644 --- a/app/scripts/lib/stream-utils.js +++ b/app/scripts/lib/stream-utils.js @@ -1,4 +1,5 @@ const Through = require('through2') +const endOfStream = require('end-of-stream') const ObjectMultiplex = require('./obj-multiplex') module.exports = { @@ -24,11 +25,11 @@ function jsonStringifyStream () { function setupMultiplex (connectionStream) { var mx = ObjectMultiplex() connectionStream.pipe(mx).pipe(connectionStream) - mx.on('error', function (err) { - console.error(err) + endOfStream(mx, function (err) { + if (err) console.error(err) }) - connectionStream.on('error', function (err) { - console.error(err) + endOfStream(connectionStream, function (err) { + if (err) console.error(err) mx.destroy() }) return mx |