Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ run = [

[tools]
bun = "latest" # for docs and test
usage = "latest" # for rendering CLI usage


[tasks.pre-commit]
depends = ["render", "lint-fix"]
Expand Down
1 change: 1 addition & 0 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl Run {
}

if let Some(code) = exit_code {
error!("Process exited with code {}", code);
std::process::exit(code);
}
Ok(())
Expand Down
3 changes: 3 additions & 0 deletions src/cli/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ impl Start {
}

if any_failed {
if last_exit_code != 0 {
error!("Process exited with code {}", last_exit_code);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Inconsistent Logging for Process Exit Codes

The application logs "Process exited with code {}" as an error for successful exit code 0, which is misleading. This occurs unconditionally in src/cli/run.rs. In src/cli/start.rs, individual daemon failures are logged for any exit code, but the final process exit message is only shown for non-zero codes, creating inconsistent failure reporting.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Error Logging Inconsistency Masks Failures

The if last_exit_code != 0 condition causes inconsistent error logging. While any_failed tracks all daemon failures, the error message only prints for non-zero exit codes. This can mask failures, as the process might exit without an error message if the last daemon exits with code 0.

Fix in Cursor Fix in Web

std::process::exit(last_exit_code);
}
Ok(())
Expand Down
26 changes: 13 additions & 13 deletions src/ipc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ use std::path::PathBuf;
pub(crate) mod client;
pub(crate) mod server;

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, strum::Display, strum::EnumIs)]
pub enum IpcMessage {
Connect(String),
ConnectOK,
Run(String, Vec<String>),
Stop(String),
DaemonAlreadyRunning(String),
DaemonAlreadyStopped(String),
DaemonStart(Daemon),
DaemonStop { name: String },
DaemonFailed { name: String, error: String },
Response(String),
}
// #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, strum::Display, strum::EnumIs)]
// pub enum IpcMessage {
// Connect(String),
// ConnectOK,
// Run(String, Vec<String>),
// Stop(String),
// DaemonAlreadyRunning(String),
// DaemonAlreadyStopped(String),
// DaemonStart(Daemon),
// DaemonStop { name: String },
// DaemonFailed { name: String, error: String },
// Response(String),
// }

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, strum::Display, strum::EnumIs)]
pub enum IpcRequest {
Expand Down
1 change: 0 additions & 1 deletion src/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ impl Supervisor {
// Another process has taken over, don't update status
return;
}
let current_daemon_clone = current_daemon.clone();
let is_stopping = current_daemon
.as_ref()
.is_some_and(|d| d.status.is_stopping());
Expand Down