From 52dc9952106e89248c7f2786bb5a3a2d938ca0fa Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Wed, 19 Jun 2013 20:57:35 -0400 Subject: [PATCH] Bug 732553 - NS_BASE_STREAM_CLOSED in dbg-transport.js. r=past --- toolkit/devtools/server/transport.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/toolkit/devtools/server/transport.js b/toolkit/devtools/server/transport.js index 412ddc3ddfc9..19d37ace91e2 100644 --- a/toolkit/devtools/server/transport.js +++ b/toolkit/devtools/server/transport.js @@ -92,7 +92,14 @@ DebuggerTransport.prototype = { onOutputStreamReady: makeInfallible(function DT_onOutputStreamReady(aStream) { - let written = aStream.write(this._outgoing, this._outgoing.length); + let written = 0; + try { + written = aStream.write(this._outgoing, this._outgoing.length); + } catch(e if e.result == Components.results.NS_BASE_STREAM_CLOSED) { + dumpn("Connection closed."); + this.close(); + return; + } this._outgoing = this._outgoing.slice(written); this._flushOutgoing(); }, "DebuggerTransport.prototype.onOutputStreamReady"),