Skip to content

Commit

Permalink
fix: dont log error if notify panics
Browse files Browse the repository at this point in the history
  • Loading branch information
christos-h authored Sep 17, 2021
1 parent 115338d commit 3df5d10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions synth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async fn main() -> Result<()> {
let args = Args::from_args();
let cli = Cli::new()?;

let notify_handle = thread::spawn(|| synth::version::notify_new_version_message().unwrap());
let notify_handle = thread::spawn(synth::version::notify_new_version_message);

#[cfg(feature = "telemetry")]
synth::cli::telemetry::with_telemetry(args, |args| cli.run(args)).await?;
Expand All @@ -24,8 +24,8 @@ async fn main() -> Result<()> {
Ok(())
}

fn print_notify(handle: JoinHandle<Option<String>>) {
if let Some(notify_message) = handle.join().unwrap_or_default() {
fn print_notify(handle: JoinHandle<Result<Option<String>>>) {
if let Ok(Ok(Some(notify_message))) = handle.join() {
eprintln!("{}", notify_message);
}
}

0 comments on commit 3df5d10

Please sign in to comment.