mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-18 06:38:38 +01:00
fix(e2e): a state that is not JSON is an error a wait goes past
komorebic state can print something else while the daemon is busy or in the middle of a monitor change. The runner crashed on it (a hotplug run did); now it is a RuntimeError with what was printed, which waits retry.
This commit is contained in:
1 parent
4cef0ce510
commit
e440a73666
1 file changed
+10
-1
@@ -330,7 +330,16 @@ class WindowsPlatform:
|
||||
return result["stdout"]
|
||||
|
||||
def state(self) -> Snapshot:
|
||||
return parse(json.loads(self.komorebic("state")))
|
||||
printed = self.komorebic("state")
|
||||
try:
|
||||
return parse(json.loads(printed))
|
||||
except ValueError as e:
|
||||
# a daemon that is busy, or in the middle of a monitor change, can
|
||||
# print something else: a wait retries, and a check that keeps
|
||||
# failing shows what it was
|
||||
raise RuntimeError(
|
||||
f"komorebic state did not print JSON ({e}): {printed[:300]!r}"
|
||||
) from e
|
||||
|
||||
def spawn(
|
||||
self, title: str, app_id: str | None = None, exe: str | None = None
|
||||
|
||||
Reference in new issue
Block a user