improve error handling
This commit is contained in:
parent
c9fa93de72
commit
355febf927
12 changed files with 443 additions and 258 deletions
10
src/lib.rs
10
src/lib.rs
|
@ -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),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue