poor man error fix

This commit is contained in:
Daylin Morgan 2024-01-23 16:16:29 -06:00
parent fc9567e379
commit 7c46d2e8fd
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -56,6 +56,7 @@ proc getData(data: string): string =
socket.close() # is this necessary? socket.close() # is this necessary?
return response return response
proc getDefaultWorkspaces(): seq[WorkspaceIcon] = proc getDefaultWorkspaces(): seq[WorkspaceIcon] =
let clients = parseJson(getData("[-j]/clients")).to(seq[Client]) let clients = parseJson(getData("[-j]/clients")).to(seq[Client])
result = collect(for i in 1..9: WorkspaceIcon(id: i, icon:"",class:fmt"ws-button-{i - 1}")) result = collect(for i in 1..9: WorkspaceIcon(id: i, icon:"",class:fmt"ws-button-{i - 1}"))
@ -81,4 +82,7 @@ proc getState(): seq[seq[WorkspaceIcon]] =
when isMainModule: when isMainModule:
while true: while true:
sleep 500 sleep 500
echo (%* getState()) try:
echo (%* getState())
except JsonParsingError:
discard