use serde::{Serialize, Serializer};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Not supported on this platform")]
UnsupportedPlatform,
#[error("macOS version is not supported (requires 26+)")]
UnsupportedMacOSVersion,
#[error("Window not found: {0}")]
WindowNotFound(String),
#[error("Failed to create glass effect view")]
ViewCreationFailed,
#[error("Failed to acquire glass view registry lock")]
RegistryLockFailed,
#[error("Invalid color format: {0}")]
InvalidColorFormat(String),
#[error("Tauri error: {0}")]
Tauri(#[from] tauri::Error),
}
impl Serialize for Error {
fn serialize<S: Serializer>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> {
serializer.serialize_str(&self.to_string())
}
}
pub type Result<T> = std::result::Result<T, Error>;