bootmgr_rs_core/
error.rs

1//! Provides [`BootError`], which encapsulates other errors
2
3use thiserror::Error;
4
5/// An `Error` resulting from the program.
6#[derive(Error, Debug)]
7pub enum BootError {
8    /// An error with UEFI, or a service from the [`uefi`] crate.
9    #[error("UEFI Error")]
10    Uefi(#[from] uefi::Error),
11
12    /// A `String` could not be converted into a `CString`
13    #[error("String Conversion Error")]
14    StrError(#[from] crate::system::helper::StrError),
15
16    /// An error occurred while performing filesystem operations.
17    #[error("Filesystem Error")]
18    FsError(#[from] crate::system::fs::FsError),
19
20    /// An error occurred while validating an image with Secure Boot.
21    #[error("Secure Boot Error")]
22    SecureBootError(#[from] crate::boot::secure_boot::SecureBootError),
23
24    /// An error occurred while building a `DevicePath`.
25    #[error("DevicePath Error")]
26    DevicePathError(#[from] crate::system::helper::DevicePathError),
27
28    /// An error occurred while loading an image.
29    #[error("Load Image Error")]
30    LoadError(#[from] crate::boot::loader::LoadError),
31
32    /// An error occurred while loading a driver.
33    #[error("Load Driver Error")]
34    DriverError(#[from] crate::system::drivers::DriverError),
35
36    /// An error occurred while loading a devicetree.
37    #[error("Devicetree Error")]
38    DevicetreeError(#[from] crate::boot::devicetree::DevicetreeError),
39
40    /// The UKI executable could not be parsed for any reason.
41    #[cfg(feature = "uki")]
42    #[error("Uki Parse Error")]
43    UkiError(#[from] crate::config::parsers::uki::UkiError),
44
45    /// The BCD could not be parsed for any reason.
46    #[cfg(feature = "windows")]
47    #[error("Win Parse Error")]
48    WinError(#[from] crate::config::parsers::windows::WinError),
49}