Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
 ryu/controller/controller.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py
index 66d50a3..60943b7 100644
--- a/ryu/controller/controller.py
+++ b/ryu/controller/controller.py
@@ -22,6 +22,7 @@ from ryu.lib.hub import StreamServer
 import traceback
 import random
 import ssl
+import sys
 
 import ryu.base.app_manager
 
@@ -311,10 +312,14 @@ def datapath_connection_factory(socket, address):
         try:
             datapath.serve()
         except:
+            exc_info = sys.exc_info()
             # Something went wrong.
             # Especially malicious switch can send malformed packet,
             # the parser raise exception.
             # Can we do anything more graceful?
-            LOG.error("Error in the datapath %s from %s",
-                      dpid_to_str(datapath.id), address)
-            raise
+            try:
+                dpid_str = dpid_to_str(datapath.id)
+            except:
+                dpid_str = "%s" % datapath.id
+            LOG.error("Error in the datapath %s from %s", dpid_str, address)
+            raise exc_info[0], exc_info[1], exc_info[2]
-- 
1.8.1.5


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to