use std::time::Duration;
#[derive(thiserror::Error, Debug)]
pub enum ServerError {
#[error("launchctl exec failed: {0}")]
LaunchctlExec(#[from] std::io::Error),
#[error("launchctl {op} failed: {stderr}")]
LaunchctlFailed {
op: &'static str,
stderr: String,
},
#[error("launchd job '{label}' is not bootstrapped. run `mse server install` first, then `mse server bootstrap`.")]
MissingJob {
label: String,
},
#[error("healthz did not respond within {duration:?} after launchctl {op}")]
HealthzTimeout {
op: &'static str,
duration: Duration,
},
#[error("render plist failed: {0}")]
Render(String),
#[error("io: {0}")]
Io(std::io::Error),
#[error("unsupported platform: mse server requires macOS launchd")]
#[cfg_attr(target_os = "macos", allow(dead_code))]
UnsupportedPlatform,
}