mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
better error handling
This commit is contained in:
parent
37146b3081
commit
69b0ba4c5c
1 changed files with 4 additions and 2 deletions
6
sock.py
6
sock.py
|
@ -45,11 +45,13 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
|||
|
||||
# convert data to json object
|
||||
# we need to do some error handling in case of socket timeout
|
||||
|
||||
try:
|
||||
received_json = json.loads(data)
|
||||
print(received_json)
|
||||
except:
|
||||
pass
|
||||
print(received_json)
|
||||
received_json = bytes()
|
||||
|
||||
|
||||
# GET COMMANDS
|
||||
# "command" : "..."
|
||||
|
|
Loading…
Reference in a new issue