use crate::cli::commands;
use crate::cli::error::{CliResult, ErrorFactory};
use crate::commands::run_dns;
use crate::logging::log_error;
pub async fn handle_dns(cmd: commands::DnsCmd, debug: bool) -> CliResult<()> {
if let Err(error) = run_dns(cmd, debug).await {
let _ = log_error("dns", "DNS command failed", Some(&error)).await;
return Err(ErrorFactory::operation(
"dns",
"run DNS workflow",
error,
Some("Use `xbp dns providers` and pass `--provider cloudflare` for supported operations."),
));
}
Ok(())
}