[Groonga-commit] droonga/express-droonga at 98d426c [master] Report error from callback function with full stack trace

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Oct 22 17:51:47 JST 2014


YUKI Hiroshi	2014-10-22 17:51:47 +0900 (Wed, 22 Oct 2014)

  New Revision: 98d426c7a679d6170930c23e30fc696386b3e091
  https://github.com/droonga/express-droonga/commit/98d426c7a679d6170930c23e30fc696386b3e091

  Message:
    Report error from callback function with full stack trace

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

  Modified: lib/droonga-protocol/receiver.js (+9 -2)
===================================================================
--- lib/droonga-protocol/receiver.js    2014-10-22 16:28:58 +0900 (c9ab65b)
+++ lib/droonga-protocol/receiver.js    2014-10-22 17:51:47 +0900 (f31c01c)
@@ -46,9 +46,16 @@ MsgPackReceiver.prototype.listen = function(callback) {
   if (this.port) {
     this._server.listen(this.port, callback);
   } else {
+    var stack = new Error().stack;
     this._server.listen((function() {
-      this.port = this._server.address().port;
-      callback();
+      try {
+        this.port = this._server.address().port;
+        callback();
+      }
+      catch(error) {
+        error.stack = error.stack + '\n' + stack;
+        throw error;
+      }
     }).bind(this));
   }
 };
-------------- next part --------------
HTML����������������������������...
다운로드 



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