sxyazi/yazi · error
{}
Error message
{} What it means
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.
Source
Thrown at yazi-cli/src/dds/exec.rs:32
pub(crate) async fn exec(cmd: CommandExec) -> anyhow::Result<Data> {
let receiver = CommandPub::receiver()?;
let req = cmd.body(*yazi_boot::ID)?;
let resp = Self::ask("dds-exec", receiver, &req, "dds-exec-result").await?;
#[derive(Deserialize)]
struct Body {
ok: bool,
#[serde(default)]
value: Data,
#[serde(default)]
error: String,
}
let body = Body::deserialize(&resp)?;
if body.ok {
Ok(body.value)
} else if !body.error.is_empty() {
bail!("{}", body.error)
} else {
bail!("Unknown error")
}
}
/// Send one custom message and wait for a matching custom reply.
async fn ask(kind: &str, receiver: Id, body: &str, reply_kind: &str) -> Result<Data> {
Ember::validate(kind)?;
Ember::validate(reply_kind)?;
let payload = try_format!(
"{}\n{kind},{receiver},{ID},{body}\n",
Payload::new(EmberHi::borrowed([reply_kind])),
)?;
let (mut lines, mut writer) = Stream::connect().await?;
writer.write_all(payload.as_bytes()).await?;
writer.flush().await?;View on GitHub (pinned to 5f901b886b)
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.
Defensive patterns
Strategy: try-catch
Try / catch
match Dds::exec(...).await {
Ok(value) => handle(value),
Err(e) => eprintln!("yazi rejected the request: {e}"), // e carries the remote body.error
} Prevention
- 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.
When it happens
Trigger: 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`.
Common situations: Sending a plugin/command message that the running Yazi cannot fulfill; stale receiver state; calling an endpoint with arguments the Yazi handler rejects.
Related errors
- Unknown error
- Expected custom payload of kind `{reply_kind}`
- Connection closed before receiving reply
- Incompatible version (Ya {}, Yazi {}). Restart all `ya` and
- No receiver found. Check if any receivers are running.
AI-assisted analysis of sxyazi/yazi@5f901b886b (2026-09-02).
Data as JSON: /api/errors/1c2f7b22d7615cc5.
Report an issue: GitHub.