windows_projfs/error.rs
1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5/// Possible errors which can occurr while library usage.
6#[derive(Debug, Error)]
7pub enum Error {
8 /// A generic error occurred within the underlying Windows API
9 #[error("{0}")]
10 GenericWindows(#[from] windows::core::Error),
11
12 /// Failed to create the projection root directory
13 #[error("failed to mark projection root: {0}")]
14 MarkProjectionRoot(windows::core::Error),
15
16 /// Failed to start the projection
17 #[error("failed to start projection: {0}")]
18 StartProjection(windows::core::Error),
19
20 /// The Windows feature "Projected File System" is not enabled.
21 /// This feature has to be enabled before using this library.
22 ///
23 /// Note:
24 /// This error can only occurr with feature "dynamic-import" else
25 /// you would receive a DLL loading error when starting your application.
26 #[error("The Windows feature \"Projected File System\" is not enabled")]
27 WindowsFeatureNotEnabled,
28
29 /// Failed to resolve certain Windows project fs API imports
30 /// which are required for this library to work.
31 #[cfg(feature = "dynamic-import")]
32 #[error("failed to resolve imports: {0}")]
33 LibraryError(#[from] libloading::Error),
34}