diff --git a/examples/hello_world.rs b/examples/hello_world.rs index 02b8c2d..760a1a5 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -1,3 +1,5 @@ -fn main() { - notifica::notify("Hello", "World! 🌍"); +use std::error::Error; + +fn main() -> Result<(), Box> { + notifica::notify("Hello", "World! 🌍") } diff --git a/src/lib.rs b/src/lib.rs index 421fd61..aa55b1c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -197,7 +197,8 @@ type CurrPlatform = MacOs; #[cfg(target_os = "linux")] type CurrPlatform = Linux; -pub fn notify(msg_title: &str, msg_body: &str) { +pub fn notify(msg_title: &str, msg_body: &str) -> Result<(), Box> { CurrPlatform::setup(); - CurrPlatform::notify(msg_title, msg_body); + CurrPlatform::notify(msg_title, msg_body)?; + Ok(()) }