Skip to content

Commit

Permalink
fix: make error enum public
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKruckenberg committed Dec 14, 2023
1 parent 5d25953 commit fe33020
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}

Expand All @@ -23,6 +23,6 @@ impl From<serde_wasm_bindgen::Error> for Error {

impl From<JsValue> for Error {
fn from(e: JsValue) -> Self {
Self::Binding(format!("{:?}", e))
Self::Command(format!("{:?}", e))
}
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = core::result::Result<T, Error>;

#[cfg(any(feature = "dialog", feature = "window"))]
Expand Down

0 comments on commit fe33020

Please sign in to comment.