tty: emit "error" instead of throwing when getWindowSize() fails
authorNathan Rajlich <nathan@tootallnate.net>
Tue, 1 May 2012 01:51:20 +0000 (18:51 -0700)
committerNathan Rajlich <nathan@tootallnate.net>
Tue, 1 May 2012 01:51:20 +0000 (18:51 -0700)
lib/tty.js

index 72dd88d..2d66abc 100644 (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];