Skip to content

Commit efafe09

Browse files
authored
Update echo_server.py
1 parent f70df81 commit efafe09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

echo_server.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import socket
22
import sys
3+
import traceback
34

45

56
def server(log_buffer=sys.stderr):
@@ -61,7 +62,9 @@ def server(log_buffer=sys.stderr):
6162
# message is a trick we learned in the lesson: if you don't
6263
# remember then ask your classmates or instructor for a clue.
6364
# :)
64-
65+
except Exception as e:
66+
traceback.print_exc()
67+
sys.exit(1)
6568
finally:
6669
# TODO: When the inner loop exits, this 'finally' clause will
6770
# be hit. Use that opportunity to close the socket you

0 commit comments

Comments
 (0)