Commits

Joel Rivera committed 05ff47b Merge

Merged in bcwalrus/cherrypy (pull request #24)

Add better error message on bind failure

  • Participants
  • Parent commits 2a2b6b7, 6b2d9b3

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 -- (%s: %s)" % (msg, sa, 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 -- (%s: %s)" % (msg, sa, serr)
                 if self.socket:
                     self.socket.close()
                 self.socket = None