use crate::cli::commands;
use crate::cli::error::{CliResult, ErrorFactory};
use crate::commands::run_workers;
use crate::logging::log_error;
pub async fn handle_workers(cmd: commands::WorkersCmd, debug: bool) -> CliResult<()> {
if let Err(error) = run_workers(cmd, debug).await {
let _ = log_error("workers", "Workers command failed", Some(&error)).await;
return Err(ErrorFactory::operation(
"workers",
"run workers workflow",
error,
Some(
"Use `xbp workers --help`, confirm Cloudflare credentials with `xbp config cloudflare show-key`, and ensure the worker project root is correct.",
),
));
}
Ok(())
}