improve error handling

This commit is contained in:
Jonas Kruckenberg 2022-11-13 21:06:06 +01:00
parent c9fa93de72
commit 355febf927
12 changed files with 443 additions and 258 deletions

View file

@ -8,17 +8,23 @@ pub mod clipboard;
pub mod event;
#[cfg(feature = "mocks")]
pub mod mocks;
#[cfg(feature = "process")]
pub mod process;
#[cfg(feature = "tauri")]
pub mod tauri;
#[cfg(feature = "window")]
pub mod window;
#[cfg(feature = "process")]
pub mod process;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
Serde(#[from] serde_wasm_bindgen::Error),
#[error("Unknown Theme \"{0}\". Expected one of \"light\",\"dark\"")]
UnknownTheme(String),
#[error("Invalid Url {0}")]
InvalidUrl(#[from] url::ParseError),
#[error("Invalid Version {0}")]
InvalidVersion(#[from] semver::Error),
#[error("{0:?}")]
Other(JsValue),
}