use std::io;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ElevateError {
#[error("Win32 API '{operation}' failed: {source}")]
Win32 {
operation: &'static str,
#[source]
source: windows::core::Error,
},
#[error("Privilege '{0}' could not be assigned")]
PrivilegeNotAssigned(&'static str),
#[error("Required system process '{0}' was not found in active session")]
ProcessNotFound(String),
#[error("Service '{name}' failed to reach running state within {seconds}s")]
ServiceTimeout {
name: String,
seconds: u64,
},
#[error("I/O query failed: {0}")]
Io(#[from] io::Error),
#[error("Target executable path must be specified")]
MissingExePath,
#[error("Token information buffer is invalid or empty")]
InvalidTokenBuffer,
}