tauri_plugin_liquid_glass/
error.rs1use serde::{Serialize, Serializer};
2
3#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 #[error("Not supported on this platform")]
8 UnsupportedPlatform,
9
10 #[error("macOS version is not supported (requires 26+)")]
12 UnsupportedMacOSVersion,
13
14 #[error("Window not found: {0}")]
16 WindowNotFound(String),
17
18 #[error("Failed to create glass effect view")]
20 ViewCreationFailed,
21
22 #[error("Failed to acquire glass view registry lock")]
24 RegistryLockFailed,
25
26 #[error("Invalid color format: {0}")]
28 InvalidColorFormat(String),
29
30 #[error("Tauri error: {0}")]
32 Tauri(#[from] tauri::Error),
33}
34
35impl Serialize for Error {
37 fn serialize<S: Serializer>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> {
38 serializer.serialize_str(&self.to_string())
39 }
40}
41
42pub type Result<T> = std::result::Result<T, Error>;