Improve error handling
This commit is contained in:
parent
795e4b20f2
commit
2ec2fda116
4 changed files with 32 additions and 36 deletions
|
|
@ -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 ;
|
||||
) ;
|
||||
} ) ;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue