[Groonga-commit] droonga/express-droonga at 138a1a5 [master] Ignore errors while closing connection

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Oct 22 17:52:23 JST 2014


YUKI Hiroshi	2014-10-22 17:52:23 +0900 (Wed, 22 Oct 2014)

  New Revision: 138a1a53d91f0062df98448b9d6671012120bb86
  https://github.com/droonga/express-droonga/commit/138a1a53d91f0062df98448b9d6671012120bb86

  Message:
    Ignore errors while closing connection

  Modified files:
    lib/droonga-protocol/connection.js

  Modified: lib/droonga-protocol/connection.js (+12 -4)
===================================================================
--- lib/droonga-protocol/connection.js    2014-10-22 17:51:47 +0900 (4af3908)
+++ lib/droonga-protocol/connection.js    2014-10-22 17:52:23 +0900 (d99c826)
@@ -237,14 +237,22 @@ Connection.prototype.close = function() {
   this.removeAllListeners();
 
   if (this._sender && typeof this._sender.end == 'function') {
-    this._sender.end();
-    this._sender.removeAllListeners();
+    try {
+      this._sender.end();
+      this._sender.removeAllListeners();
+    }
+    catch(error) {
+    }
     delete this._sender;
   }
 
   if (this._receiver && typeof this._receiver.close == 'function') {
-    this._receiver.close();
-    this._receiver.removeAllListeners();
+    try {
+      this._receiver.close();
+      this._receiver.removeAllListeners();
+    }
+    catch(error) {
+    }
     delete this._receiver;
   }
   this.closed = true;
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index