use thiserror::Error; use glib::variant::Variant; use std::fmt; #[derive(Debug, Error)] pub enum ParseError { #[error("dconf path must begin with a slash")] BadPath, #[error("dconf key must end with a slash")] NotDir, #[error("dconf dir must not end with a slash")] NotKey, #[error("{0}")] NulError(#[from] std::ffi::NulError) } #[derive(Debug, Error)] #[error("failed to convert to type")] pub struct FromVariantConversionError(pub Variant); #[derive(Debug, Error)] pub enum Error { #[error("failed to parse path: {0}")] ParseError(E), #[error("{0}")] FromVariantConversionError(#[from] FromVariantConversionError), #[error("{0}")] GlibError(#[from] glib::error::Error), }