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

  1. Read the propagated `body.error` text — it is the actual Yazi-side failure — and fix the request payload accordingly.
  2. Confirm the receiver's state (files open, cwd, plugins loaded) matches what the message assumes.
  3. 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

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


AI-assisted analysis of sxyazi/yazi@5f901b886b (2026-09-02). Data as JSON: /api/errors/1c2f7b22d7615cc5. Report an issue: GitHub.