From fe330206aad9d9a42731d37ee6ee9e6eef327c5a Mon Sep 17 00:00:00 2001 From: Jonas Kruckenberg Date: Thu, 14 Dec 2023 11:23:59 +0100 Subject: [PATCH] fix: make error enum public --- src/error.rs | 10 +++++----- src/lib.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/error.rs b/src/error.rs index 65d4389..4e707a8 100644 --- a/src/error.rs +++ b/src/error.rs @@ -3,15 +3,15 @@ use wasm_bindgen::JsValue; #[derive(Clone, Eq, PartialEq, Debug, thiserror::Error)] pub enum Error { - #[error("JS Binding: {0}")] - Binding(String), - #[error("JSON: {0}")] + #[error("Command returned Error: {0}")] + Command(String), + #[error("Failed to parse JSON: {0}")] Serde(String), #[cfg(any(feature = "event", feature = "window"))] #[error("Oneshot cancelled: {0}")] OneshotCanceled(#[from] futures::channel::oneshot::Canceled), #[cfg(feature = "fs")] - #[error("could not convert path to string")] + #[error("Could not convert path to string")] Utf8(PathBuf), } @@ -23,6 +23,6 @@ impl From for Error { impl From for Error { fn from(e: JsValue) -> Self { - Self::Binding(format!("{:?}", e)) + Self::Command(format!("{:?}", e)) } } diff --git a/src/lib.rs b/src/lib.rs index 51f5244..723d494 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -148,7 +148,7 @@ pub mod updater; #[cfg(feature = "window")] pub mod window; -pub(crate) use error::Error; +pub use error::Error; pub(crate) type Result = core::result::Result; #[cfg(any(feature = "dialog", feature = "window"))]