Skip to content

Commit f70df81

Browse files
authored
Update echo_client.py
1 parent b2f90cd commit f70df81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

echo_client.py

+4
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 client(msg, log_buffer=sys.stderr):
@@ -29,6 +30,9 @@ def client(msg, log_buffer=sys.stderr):
2930
# do it. This will help in debugging problems
3031
chunk = ''
3132
print('received "{0}"'.format(chunk.decode('utf8')), file=log_buffer)
33+
except Exception as e:
34+
traceback.print_exc()
35+
sys.exit(1)
3236
finally:
3337
# TODO: after you break out of the loop receiving echoed chunks from
3438
# the server you will want to close your client socket.

0 commit comments

Comments
 (0)