mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
update error handle
This commit is contained in:
parent
00d130e107
commit
3179b6a33a
2 changed files with 24 additions and 28 deletions
21
src/main.rs
21
src/main.rs
|
|
@ -8,8 +8,23 @@ use profile::Profile;
|
|||
use std::rc::Rc;
|
||||
|
||||
fn main() -> ExitCode {
|
||||
match gtk::init() {
|
||||
Ok(_) => App::build(&Rc::new(Profile::new().unwrap())).run(),
|
||||
Err(_) => ExitCode::FAILURE,
|
||||
match Profile::new() {
|
||||
Ok(profile) => {
|
||||
if let Err(e) = gtk::init() {
|
||||
eprintln!("Failed to initialize GTK: {e}");
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
match App::build(&Rc::new(profile)).run() {
|
||||
Ok(result) => result,
|
||||
Err(e) => {
|
||||
eprintln!("Failed to initialize application: {e}");
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Failed to initialize profile: {e}");
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue