Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit 91cef6d

Browse files
committed
properly handle OSError when socket bind fails
1 parent 67c59d6 commit 91cef6d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pugdebug/server.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,8 @@ def __connect_server(self):
250250
self.wait_for_accept = False
251251
self.is_waiting = False
252252

253-
except OSError:
254-
print(OSError.strerror())
255-
print("Socket bind failed")
253+
except OSError as e:
254+
response = {'error': e.strerror}
256255
finally:
257256
socket_server.close()
258257

0 commit comments

Comments
 (0)