tray_icon/
error.rs

1// Copyright 2022-2022 Tauri Programme within The Commons Conservancy
2// SPDX-License-Identifier: Apache-2.0
3// SPDX-License-Identifier: MIT
4
5use thiserror::Error;
6
7/// Errors returned by tray-icon.
8#[non_exhaustive]
9#[derive(Error, Debug)]
10pub enum Error {
11    #[error(transparent)]
12    OsError(#[from] std::io::Error),
13    #[cfg(any(target_os = "linux", target_os = "macos"))]
14    #[error(transparent)]
15    PngEncodingError(#[from] png::EncodingError),
16    #[error("not on the main thread")]
17    NotMainThread,
18}
19
20/// Convenient type alias of Result type for tray-icon.
21pub type Result<T> = std::result::Result<T, Error>;