aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-02-11 03:46:13 +0800
committerkumavis <aaron@kumavis.me>2016-02-11 03:46:13 +0800
commit066996396ff0ec6a9f6724e1f6469a0bc67a07ca (patch)
tree5c9e34bd1fe94ffcd2c96b2c288b879258f22489 /app/scripts/lib
parentebf60843fabd743cbf821611fc9343e1d4a323b7 (diff)
downloadtangerine-wallet-browser-066996396ff0ec6a9f6724e1f6469a0bc67a07ca.tar.gz
tangerine-wallet-browser-066996396ff0ec6a9f6724e1f6469a0bc67a07ca.tar.zst
tangerine-wallet-browser-066996396ff0ec6a9f6724e1f6469a0bc67a07ca.zip
context wiring - handle and log errors
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/port-stream.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/scripts/lib/port-stream.js b/app/scripts/lib/port-stream.js
index 7f3e8072e..8ff77ec4e 100644
--- a/app/scripts/lib/port-stream.js
+++ b/app/scripts/lib/port-stream.js
@@ -37,8 +37,13 @@ PortDuplexStream.prototype._read = noop
PortDuplexStream.prototype._write = function(msg, encoding, cb){
// console.log('PortDuplexStream - sent message', msg)
- this._port.postMessage(msg)
- cb()
+ try {
+ this._port.postMessage(msg)
+ cb()
+ } catch(err){
+ // this.emit('error', err)
+ cb(new Error('PortDuplexStream - disconnected'))
+ }
}
// util