poor man error fix
This commit is contained in:
parent
fc9567e379
commit
7c46d2e8fd
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue