use std::fmt;
#[derive(Debug)]
pub enum PluginError {
InitializationFailed(String),
ProcessingError(String),
StateError(String),
EditorError(String),
PlatformError(String),
WebViewError(String),
}
impl fmt::Display for PluginError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::InitializationFailed(msg) => write!(f, "Initialization failed: {}", msg),
Self::ProcessingError(msg) => write!(f, "Processing error: {}", msg),
Self::StateError(msg) => write!(f, "State error: {}", msg),
Self::EditorError(msg) => write!(f, "Editor error: {}", msg),
Self::PlatformError(msg) => write!(f, "Platform error: {}", msg),
Self::WebViewError(msg) => write!(f, "WebView error: {}", msg),
}
}
}
impl std::error::Error for PluginError {}
pub type PluginResult<T> = Result<T, PluginError>;