diff --git a/src/main.rs b/src/main.rs index 0a34ae3..dc21ce5 100755 --- a/src/main.rs +++ b/src/main.rs @@ -2222,9 +2222,16 @@ where fn add_library() -> Task { cosmic::Task::future(library::add_db()).then(|res| { - Task::perform(Library::new(Arc::new(res.expect("probs"))), |x| { - cosmic::Action::App(Message::AddLibrary(x)) - }) + Task::perform( + Library::new(Arc::new(match res { + Ok(db) => db, + Err(e) => { + error!("{e}"); + panic!("{e}") + } + })), + |x| cosmic::Action::App(Message::AddLibrary(x)), + ) }) }