We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f70df81 commit efafe09Copy full SHA for efafe09
echo_server.py
@@ -1,5 +1,6 @@
1
import socket
2
import sys
3
+import traceback
4
5
6
def server(log_buffer=sys.stderr):
@@ -61,7 +62,9 @@ def server(log_buffer=sys.stderr):
61
62
# message is a trick we learned in the lesson: if you don't
63
# remember then ask your classmates or instructor for a clue.
64
# :)
-
65
+ except Exception as e:
66
+ traceback.print_exc()
67
+ sys.exit(1)
68
finally:
69
# TODO: When the inner loop exits, this 'finally' clause will
70
# be hit. Use that opportunity to close the socket you
0 commit comments