{"record":{"id":"1c2f7b22d7615cc5","repo":"sxyazi/yazi","slug":"error","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-cli/src/dds/exec.rs","lineNumber":32,"sourceCode":"\tpub(crate) async fn exec(cmd: CommandExec) -> anyhow::Result<Data> {\n\t\tlet receiver = CommandPub::receiver()?;\n\t\tlet req = cmd.body(*yazi_boot::ID)?;\n\t\tlet resp = Self::ask(\"dds-exec\", receiver, &req, \"dds-exec-result\").await?;\n\n\t\t#[derive(Deserialize)]\n\t\tstruct Body {\n\t\t\tok:    bool,\n\t\t\t#[serde(default)]\n\t\t\tvalue: Data,\n\t\t\t#[serde(default)]\n\t\t\terror: String,\n\t\t}\n\n\t\tlet body = Body::deserialize(&resp)?;\n\t\tif body.ok {\n\t\t\tOk(body.value)\n\t\t} else if !body.error.is_empty() {\n\t\t\tbail!(\"{}\", body.error)\n\t\t} else {\n\t\t\tbail!(\"Unknown error\")\n\t\t}\n\t}\n\n\t/// Send one custom message and wait for a matching custom reply.\n\tasync fn ask(kind: &str, receiver: Id, body: &str, reply_kind: &str) -> Result<Data> {\n\t\tEmber::validate(kind)?;\n\t\tEmber::validate(reply_kind)?;\n\n\t\tlet payload = try_format!(\n\t\t\t\"{}\\n{kind},{receiver},{ID},{body}\\n\",\n\t\t\tPayload::new(EmberHi::borrowed([reply_kind])),\n\t\t)?;\n\n\t\tlet (mut lines, mut writer) = Stream::connect().await?;\n\t\twriter.write_all(payload.as_bytes()).await?;\n\t\twriter.flush().await?;","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-cli/src/dds/exec.rs#L14-L50","documentation":"In `Dds::exec`, the client deserializes the response body of a DDS (daemon-to-daemon) request; when `body.ok` is false and `body.error` is non-empty, the server-side error string is re-raised verbatim via `bail!(\"{}\", body.error)`. This is the transport of a remote (Yazi-side) failure back to the `ya` caller.","triggerScenarios":"Any `ya pub`/`ya call` where the Yazi-side handler returns an error — e.g. requesting an action on a file that disappeared, or an unsupported message for the current state; the server puts its message into `body.error`.","commonSituations":"Sending a plugin/command message that the running Yazi cannot fulfill; stale receiver state; calling an endpoint with arguments the Yazi handler rejects.","solutions":["Read the propagated `body.error` text — it is the actual Yazi-side failure — and fix the request payload accordingly.","Confirm the receiver's state (files open, cwd, plugins loaded) matches what the message assumes.","Upgrade both `yazi` and `ya` together if the message kind or payload schema changed between versions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match Dds::exec(...).await {\n  Ok(value) => handle(value),\n  Err(e) => eprintln!(\"yazi rejected the request: {e}\"), // e carries the remote body.error\n}","preventionTips":["Validate message kinds and payload arguments against the receiver's advertised abilities before sending.","Keep request payloads minimal and matching the handler's schema.","Read the propagated error text — it describes the actual Yazi-side failure."],"tags":["ipc","dds","remote-error"],"backgroundTag":"remote-request-failed","analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}