We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b2f90cd commit f70df81Copy full SHA for f70df81
echo_client.py
@@ -1,5 +1,6 @@
1
import socket
2
import sys
3
+import traceback
4
5
6
def client(msg, log_buffer=sys.stderr):
@@ -29,6 +30,9 @@ def client(msg, log_buffer=sys.stderr):
29
30
# do it. This will help in debugging problems
31
chunk = ''
32
print('received "{0}"'.format(chunk.decode('utf8')), file=log_buffer)
33
+ except Exception as e:
34
+ traceback.print_exc()
35
+ sys.exit(1)
36
finally:
37
# TODO: after you break out of the loop receiving echoed chunks from
38
# the server you will want to close your client socket.
0 commit comments