cadmus_core/device/usb/
error.rs

1//! USB error types.
2
3use thiserror::Error;
4
5/// Errors that can occur during USB operations.
6#[derive(Error, Debug)]
7pub enum UsbError {
8    /// Failed to read device information.
9    #[error("Failed to read device info: {0}")]
10    DeviceInfo(String),
11
12    /// USB gadget configuration failed.
13    #[error("USB gadget configuration failed: {0}")]
14    GadgetConfig(String),
15
16    /// Kernel module operation failed.
17    #[error("Kernel module operation failed: {0}")]
18    KernelModule(String),
19
20    /// Partition operation failed.
21    #[error("Partition operation failed: {0}")]
22    Partition(String),
23
24    /// Filesystem check failed.
25    #[error("Filesystem check failed: {0}")]
26    Filesystem(String),
27
28    /// UDC not available.
29    #[error("UDC not available: {0}")]
30    Udc(String),
31
32    /// I/O error.
33    #[error("I/O error: {0}")]
34    Io(#[from] std::io::Error),
35}