use std::time::Duration;
use crate::vms::VmId;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("Couldn't find {tool} in {searched}")]
MissingTool {
tool: &'static str,
searched: &'static str,
},
#[error(
"vsock is not supported on this system. \
This usually means the vhost_vsock kernel module is not loaded. \
Try running: sudo modprobe vhost_vsock"
)]
VsockUnavailable,
#[error("vmid '{0}' already exists")]
VmIdExists(VmId),
#[error("no virtual machine with vmid '{0}'")]
VmNotFound(VmId),
#[error("Reached timeout trying to connect to virtual machine via SSH, aborting")]
SshTimeout(Duration),
#[error(transparent)]
Other(#[from] eyre::Report),
}