tty: emit "error" instead of throwing when getWindowSize() fails

This commit is contained in:
Nathan Rajlich 2012-04-30 18:51:20 -07:00
parent 6cacb9a21e
commit f4403f90f8

View File

@ -101,7 +101,7 @@ WriteStream.prototype._refreshSize = function() {
var oldRows = this.rows;
var winSize = this._handle.getWindowSize();
if (!winSize) {
throw errnoException(errno, 'getWindowSize');
this.emit('error', errnoException(errno, 'getWindowSize'));
}
var newCols = winSize[0];
var newRows = winSize[1];