Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions WayKey/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def send_command(command: dict) -> dict:
client.sendall(json.dumps(command).encode('utf-8'))
response = client.recv(4096).decode('utf-8')
return json.loads(response)
except socket.error as e:
print("Could not connect to the WayKey daemon. Is it running?")
return {"status": "error", "message": str(e)}
finally:
client.close()

Expand Down
3 changes: 3 additions & 0 deletions WayKey/library/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def _send_command(command: dict) -> dict:
client.sendall(json.dumps(command).encode('utf-8'))
response = client.recv(4096).decode('utf-8')
return json.loads(response)
except socket.error as err:
print("Could not connect to the WayKey daemon. Is it running?")
return {"status": "error", "message": str(err)}
finally:
client.close()

Expand Down