Skip to content

Commit

Permalink
refactor(agents): Rename CommandError::FailedWithOutput to `Command…
Browse files Browse the repository at this point in the history
…Error::NonZeroExit` (#484)

Better describes what is going on. I.e. `rg` exits with 1 if nothing is
found, tests generally do the same if they fail.
  • Loading branch information
timonv authored Dec 16, 2024
1 parent c92e662 commit d255772
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion swiftide-agents/src/tools/local_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
}

Expand Down
4 changes: 2 additions & 2 deletions swiftide-core/src/agent_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d255772

Please sign in to comment.