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
6
sock.py
6
sock.py
|
@ -45,11 +45,13 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
||||||
|
|
||||||
# convert data to json object
|
# convert data to json object
|
||||||
# we need to do some error handling in case of socket timeout
|
# we need to do some error handling in case of socket timeout
|
||||||
|
|
||||||
try:
|
try:
|
||||||
received_json = json.loads(data)
|
received_json = json.loads(data)
|
||||||
|
print(received_json)
|
||||||
except:
|
except:
|
||||||
pass
|
received_json = bytes()
|
||||||
print(received_json)
|
|
||||||
|
|
||||||
# GET COMMANDS
|
# GET COMMANDS
|
||||||
# "command" : "..."
|
# "command" : "..."
|
||||||
|
|
Loading…
Reference in a new issue