1use thiserror::Error;
6
7#[non_exhaustive]
9#[derive(Error, Debug)]
10pub enum Error {
11 #[error(transparent)]
12 OsError(#[from] std::io::Error),
13 #[cfg(any(
14 any(
15 target_os = "linux",
16 target_os = "dragonfly",
17 target_os = "freebsd",
18 target_os = "netbsd",
19 target_os = "openbsd"
20 ),
21 target_os = "macos"
22 ))]
23 #[error(transparent)]
24 PngEncodingError(#[from] png::EncodingError),
25 #[error("not on the main thread")]
26 NotMainThread,
27}
28
29pub type Result<T> = std::result::Result<T, Error>;