Update for "write after end" uncaught error.

This commit is contained in:
Ryan Wilson 2014-06-20 13:16:23 -07:00
parent ca5272aacc
commit b12200fabc

View File

@ -48,7 +48,14 @@ BaseRollingFileStream.prototype._write = function(chunk, encoding, callback) {
function writeTheChunk() { function writeTheChunk() {
debug("writing the chunk to the underlying stream"); debug("writing the chunk to the underlying stream");
that.currentSize += chunk.length; that.currentSize += chunk.length;
that.theStream.write(chunk, encoding, callback); if(that.theStream.writeable) {
try {
that.theStream.write(chunk, encoding, callback);
}
catch (err){
callback();
}
}
} }
debug("in _write"); debug("in _write");