user_notify/
error.rs

1#![allow(missing_docs)]
2
3use std::path::PathBuf;
4
5/// user-notify error type
6#[derive(Debug, thiserror::Error)]
7pub enum Error {
8    // #[error(transparent)]
9    // Tauri(#[from] tauri::Error),
10    // #[error("window label not found in HtmlEmailInstancesState")]
11    // WindowNotFoundInState,
12    #[cfg(any(target_os = "macos", target_os = "ios"))]
13    #[error("bundle id is not set, this is required to send notifications")]
14    NoBundleId,
15    #[cfg(any(target_os = "macos", target_os = "ios"))]
16    #[error("macOS apis need to be called from the main thread, but this is not the main thread")]
17    NotMainThread,
18    #[cfg(any(target_os = "macos", target_os = "ios"))]
19    #[error("NSError: {0}")]
20    NSError(String),
21    #[cfg(any(target_os = "macos", target_os = "ios"))]
22    #[error(transparent)]
23    IoError(#[from] std::io::Error),
24    #[error("Infallible error, something went really wrong: {0}")]
25    Infallible(#[from] std::convert::Infallible),
26    #[error(transparent)]
27    TokioRecv(#[from] tokio::sync::oneshot::error::RecvError),
28    #[error(transparent)]
29    TokioTryLock(#[from] tokio::sync::TryLockError),
30    #[error("Url from path parse error {0:?}")]
31    ParseUrlFromPath(PathBuf),
32    #[cfg(target_os = "windows")]
33    #[error(transparent)]
34    Windows(#[from] windows::core::Error),
35    #[cfg(target_os = "windows")]
36    #[error("Failed to parse user info {0:?}")]
37    FailedToParseUserInfo(serde_json::Error),
38    #[cfg(target_os = "windows")]
39    #[error("Error Setting Handler Callback")]
40    SettingHandler,
41    #[cfg(target_os = "windows")]
42    #[error(transparent)]
43    XmlEscape(#[from] quick_xml::escape::EscapeError),
44    #[cfg(target_os = "windows")]
45    #[error(transparent)]
46    UrlParse(#[from] url::ParseError),
47    #[cfg(target_os = "windows")]
48    #[error(transparent)]
49    Base64Decode(#[from] base64::DecodeError),
50    #[cfg(any(
51        target_os = "linux",
52        target_os = "dragonfly",
53        target_os = "freebsd",
54        target_os = "openbsd",
55        target_os = "netbsd"
56    ))]
57    #[error(transparent)]
58    RustNotifyError(#[from] notify_rust::error::Error),
59}