From 4d76e4213fe755a32cd5391399435be28a1eaebd Mon Sep 17 00:00:00 2001 From: Timon Vonk Date: Thu, 12 Dec 2024 16:02:01 +0100 Subject: [PATCH] feat(agents): Rename `CommandError::FailedWithOutput` to `CommandError::NonZeroExit` Better describes what is going on. I.e. `rg` exits with 1 if nothing is found, tests generally do the same if they fail. --- swiftide-agents/src/tools/local_executor.rs | 2 +- swiftide-core/src/agent_traits.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swiftide-agents/src/tools/local_executor.rs b/swiftide-agents/src/tools/local_executor.rs index e0cdae98..d80571c4 100644 --- a/swiftide-agents/src/tools/local_executor.rs +++ b/swiftide-agents/src/tools/local_executor.rs @@ -49,7 +49,7 @@ impl LocalExecutor { if output.status.success() { Ok(merged_output.into()) } else { - Err(CommandError::FailedWithOutput(merged_output.into())) + Err(CommandError::NonZeroExit(merged_output.into())) } } diff --git a/swiftide-core/src/agent_traits.rs b/swiftide-core/src/agent_traits.rs index b40d2f6d..2b46ac77 100644 --- a/swiftide-core/src/agent_traits.rs +++ b/swiftide-core/src/agent_traits.rs @@ -25,8 +25,8 @@ pub enum CommandError { ExecutorError(#[from] anyhow::Error), /// The command failed, i.e. failing tests with stderr. This error might be handled - #[error("command failed: {0}")] - FailedWithOutput(CommandOutput), + #[error("command failed with NonZeroExit: {0}")] + NonZeroExit(CommandOutput), } /// Commands that can be executed by the executor