move error handle outside

This commit is contained in:
yggverse 2024-10-04 02:57:50 +03:00
parent caee762103
commit 73ab25efdf
2 changed files with 13 additions and 34 deletions

View file

@ -31,8 +31,11 @@ pub struct App {
impl App {
// Construct
pub fn new(profile_database_connection: Arc<Connection>) -> Self {
// Init app database model
let database = Arc::new(Database::init(profile_database_connection));
// Init database model
let database = match Database::init(profile_database_connection) {
Ok(database) => Arc::new(database),
Err(e) => panic!("{e}"), // @TODO
};
// Init actions
let action_debug = Action::new("win", true);