1/// General purpose error type for this crate. 2#[derive(Debug, thiserror::Error)] 3pub enum Error { 4 /// Custom. 5 #[error("custom: {0}")] 6 Custom(String), 7} 8 9impl Error { 10 /// Create a custom error. 11 pub fn custom(msg: impl ToString) -> Self { 12 Self::Custom(msg.to_string()) 13 } 14}