Commits

bc Wong  committed 9cf3f45 Draft

Add better error message on bind failure

  • Participants
  • Parent commits 48ec086

Comments (0)

Files changed (2)

File cherrypy/wsgiserver/wsgiserver2.py

             af, socktype, proto, canonname, sa = res
             try:
                 self.bind(af, socktype, proto)
-            except socket.error:
+            except socket.error, serr:
+                msg = "%s on %s -- %s" % (msg, self.bind_addr, serr)
                 if self.socket:
                     self.socket.close()
                 self.socket = None

File cherrypy/wsgiserver/wsgiserver3.py

             af, socktype, proto, canonname, sa = res
             try:
                 self.bind(af, socktype, proto)
-            except socket.error:
+            except socket.error, serr:
+                msg = "%s on %s -- %s" % (msg, self.bind_addr, serr)
                 if self.socket:
                     self.socket.close()
                 self.socket = None