use thiserror::Error;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
OsError(#[from] std::io::Error),
#[cfg(any(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
),
target_os = "macos"
))]
#[error(transparent)]
PngEncodingError(#[from] png::EncodingError),
#[error("not on the main thread")]
NotMainThread,
#[cfg(all(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
),
feature = "ksni"
))]
#[error(transparent)]
Ksni(#[from] ksni::Error),
}
pub type Result<T> = std::result::Result<T, Error>;