update error handlers

This commit is contained in:
yggverse 2024-10-06 00:49:43 +03:00
parent 271acd50ed
commit 5a22e73b50
5 changed files with 37 additions and 37 deletions

View file

@ -28,22 +28,22 @@ impl Widget {
// Init writable database connection
let mut connection = match profile_database_connection.write() {
Ok(connection) => connection,
Err(error) => todo!("{error}"),
Err(e) => todo!("{e}"),
};
// Init new transaction
let transaction = match connection.transaction() {
Ok(transaction) => transaction,
Err(error) => todo!("{error}"),
Err(e) => todo!("{e}"),
};
// Init database structure
match Database::init(&transaction) {
Ok(database) => match transaction.commit() {
Ok(_) => Arc::new(database),
Err(error) => todo!("{error}"),
Err(e) => todo!("{e}"),
},
Err(error) => todo!("{error}"),
Err(e) => todo!("{e}"),
}
};
@ -73,11 +73,11 @@ impl Widget {
// Delegate clean action to childs
// nothing yet..
}
Err(error) => panic!("{error}"), // @TODO
Err(e) => todo!("{e}"),
}
}
}
Err(error) => panic!("{error}"), // @TODO
Err(e) => todo!("{e}"),
}
}
@ -94,7 +94,7 @@ impl Widget {
// nothing yet..
}
}
Err(error) => panic!("{error}"), // @TODO
Err(e) => todo!("{e}"),
}
}
@ -111,7 +111,7 @@ impl Widget {
// let id = self.database.last_insert_id();
// nothing yet..
}
Err(error) => panic!("{error}"), // @TODO
Err(e) => todo!("{e}"),
}
}

View file

@ -179,7 +179,7 @@ impl Page {
// Get host
let host = match uri.host() {
Some(host) => host,
None => panic!(),
None => todo!(),
};
// Update
@ -358,7 +358,7 @@ impl Page {
// Close connection
if let Err(e) = connection.close(Some(&cancellable)) {
panic!("Error closing connection: {:?}", e);
todo!("Error closing connection: {:?}", e);
}
}
Err(e) => {
@ -371,7 +371,7 @@ impl Page {
// Close connection
if let Err(e) = connection.close(Some(&cancellable)) {
panic!("Error closing response connection: {:?}", e);
todo!("Error closing response connection: {:?}", e);
}
}
},
@ -387,7 +387,7 @@ impl Page {
// Close connection
if let Err(e) = connection.close(Some(&cancellable)) {
panic!("Error closing request connection: {:?}", e);
todo!("Error closing request connection: {:?}", e);
}
}
},