Bug 732553 - NS_BASE_STREAM_CLOSED in dbg-transport.js. r=past

This commit is contained in:
Alexandre Poirot 2013-06-19 20:57:35 -04:00
parent 01995dd019
commit bf05e64bbe

View File

@ -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"),