Improve error handling

This commit is contained in:
Reinout Meliesie 2025-02-12 11:34:38 +01:00
commit 2ec2fda116
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
4 changed files with 32 additions and 36 deletions

View file

@ -42,19 +42,19 @@ fn show_window ( application : & Application ) {
ui . show_window () ;
spawn_future_local ( async move {
async_unit_result_context (
async_result_context ! (
async {
let data_manager = DataManager :: new () . await ? ;
let collection = data_manager . get_collection_overview () . await ;
let collection = data_manager . get_collection_overview () . await ? ;
ui . render_collection_overview (collection) . await ;
Ok (())
} ,
|error| {
err => |error| {
match error {
CollectionFileReadError => eprintln ! ("Could not read collection file") ,
} ;
ui . close_window () ;
} ,
) . await ;
) ;
} ) ;
}