{"record":{"id":"04a60026bdde4761","repo":"LGUG2Z/komorebi","slug":"error","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"komorebic/src/main.rs","lineNumber":1589,"sourceCode":"    NotificationSchema,\n    /// Generate a JSON Schema of socket messages\n    SocketSchema,\n    /// Generate a JSON Schema of the static configuration file\n    StaticConfigSchema,\n    /// Generates a static configuration JSON file based on the current window manager state\n    GenerateStaticConfig,\n    /// Generates the komorebi.lnk shortcut in shell:startup to autostart komorebi\n    EnableAutostart(EnableAutostart),\n    /// Deletes the komorebi.lnk shortcut in shell:startup to disable autostart\n    DisableAutostart,\n}\n\n// print_query is a helper that queries komorebi and prints the response.\n// panics on error.\nfn print_query(message: &SocketMessage) {\n    match send_query(message) {\n        Ok(response) => println!(\"{response}\"),\n        Err(error) => panic!(\"{}\", error),\n    }\n}\n\nfn startup_dir() -> eyre::Result<PathBuf> {\n    let startup = dirs::home_dir()\n        .expect(\"unable to obtain user's home folder\")\n        .join(\"AppData\")\n        .join(\"Roaming\")\n        .join(\"Microsoft\")\n        .join(\"Windows\")\n        .join(\"Start Menu\")\n        .join(\"Programs\")\n        .join(\"Startup\");\n\n    if !startup.is_dir() {\n        std::fs::create_dir_all(&startup)?;\n    }\n","sourceCodeStart":1571,"sourceCodeEnd":1607,"githubUrl":"https://github.com/LGUG2Z/komorebi/blob/e0709f02bfae4e503bf4640f58ee75ecbbfdbb97/komorebic/src/main.rs#L1571-L1607","documentation":"print_query is a komorebic helper that sends a query socket message to the komorebi process and prints the response. If send_query fails (connection failure, timeout, malformed response), the helper panics by formatting the underlying error into the panic message via panic!(\"{}\", error).","triggerScenarios":"Calling any komorebic query subcommand (e.g. `komorebic query`, state/monitor queries) when komorebi is not running, the named pipe/socket is unavailable, the request timed out, or the response could not be decoded.","commonSituations":"Running a query command before starting komorebi; komorebi crashed or was restarted; wrong KOMOREBI_SOCKET name; permission issues on the socket; version mismatch between komorebic and komorebi.","solutions":["Start komorebi first (komorebic start) and confirm it is running before querying.","Check komorebic and komorebi are the same version (komorebic --version vs the running process).","Run the command inside the same user session / with correct privileges so the socket is reachable.","Catch the underlying error text in the panic message to identify connection vs decode failure."],"exampleFix":"// before\nkomorebic query --state   # komorebi not running -> panic\n// after\nkomorebic start\nkomorebic query --state","handlingStrategy":"try-catch","validationCode":"komorebic state 2>$null; if ($LASTEXITCODE -ne 0) { throw 'komorebi is not running; start it before querying' }","typeGuard":null,"tryCatchPattern":"match std::panic::catch_unwind(|| print_query(&msg)) {\n    Ok(_) => {},\n    Err(e) => eprintln!(\"query failed — is komorebi running? {:?}\", e),\n}","preventionTips":["Always start komorebi before running komorebic query commands","Keep komorebic and komorebi versions in sync","Run queries from the same user session as komorebi"],"tags":["socket","ipc","query"],"backgroundTag":"connection-refused","analyzedSha":"e0709f02bfae4e503bf4640f58ee75ecbbfdbb97","analyzedAt":"2026-09-06T07:08:05.107Z","contentChangedAt":"2026-09-06T07:08:05.107Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}