diff --git a/core/tauri/src/error.rs b/core/tauri/src/error.rs index 7505e58d2..b4e2c08ee 100644 --- a/core/tauri/src/error.rs +++ b/core/tauri/src/error.rs @@ -51,8 +51,8 @@ pub enum Error { #[error("invalid args for command `{0}`: {1}")] InvalidArgs(&'static str, serde_json::Error), /// Encountered an error in the setup hook, - #[error("error encountered during setup hood: {0}")] - Setup(#[from] Box), + #[error("error encountered during setup hook: {0}")] + Setup(String), /// Tauri updater error. #[cfg(feature = "updater")] #[error("Updater: {0}")] diff --git a/core/tauri/src/runtime/app.rs b/core/tauri/src/runtime/app.rs index 2be27a06d..21e225a44 100644 --- a/core/tauri/src/runtime/app.rs +++ b/core/tauri/src/runtime/app.rs @@ -262,7 +262,7 @@ where #[cfg(feature = "updater")] app.run_updater(main_window); - (self.setup)(&mut app)?; + (self.setup)(&mut app).map_err(|e| crate::Error::Setup(e.to_string()))?; app.runtime.run(); Ok(()) }