Files
krata/crates/xen/xencall/src/error.rs

22 lines
658 B
Rust
Raw Normal View History

2024-01-30 18:09:26 -08:00
use std::io;
#[derive(thiserror::Error, Debug)]
pub enum Error {
2024-03-10 00:22:24 +00:00
#[error("version of xen is not supported")]
XenVersionUnsupported,
#[error("kernel error: {0}")]
2024-01-30 18:09:26 -08:00
Kernel(#[from] nix::errno::Errno),
2024-03-10 00:22:24 +00:00
#[error("io issue encountered: {0}")]
2024-01-30 18:09:26 -08:00
Io(#[from] io::Error),
2024-04-02 00:56:18 +00:00
#[error("failed to acquire semaphore: {0}")]
AcquireSemaphoreFailed(#[from] tokio::sync::AcquireError),
2024-01-30 18:09:26 -08:00
#[error("populate physmap failed")]
PopulatePhysmapFailed,
2024-04-02 00:56:18 +00:00
#[error("mmap batch failed: {0}")]
MmapBatchFailed(nix::errno::Errno),
#[error("specified value is too long")]
ValueTooLong,
2024-01-30 18:09:26 -08:00
}
pub type Result<T> = std::result::Result<T, Error>;