diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-04-24 10:36:49 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-04-24 10:36:49 -0400 |
commit | 6e95a6600679e6787a56ec5ef2a88fe0fbcf031f (patch) | |
tree | 4495e3a2bbb12b96b0b767ab1b844040c7cc4c71 /src/commands/delete_files.rs | |
parent | e9a0d00d46ba4955f7d45d12aa412462e3daab39 (diff) |
add more error handling
- optimize/cleanup code
Diffstat (limited to 'src/commands/delete_files.rs')
-rw-r--r-- | src/commands/delete_files.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/commands/delete_files.rs b/src/commands/delete_files.rs index 071f629..035099d 100644 --- a/src/commands/delete_files.rs +++ b/src/commands/delete_files.rs @@ -58,15 +58,16 @@ impl JoshutoRunnable for DeleteFiles { if let Some(paths) = s.get_selected_paths() { match Self::remove_files(paths) { Ok(_) => ui::wprint_msg(&view.bot_win, "Deleted files"), - Err(e) => { - return Err(JoshutoError::IO(e)); - } + Err(e) => return Err(JoshutoError::IO(e)), } } } let curr_tab = &mut context.tabs[context.curr_tab_index]; - curr_tab.reload_contents(&context.config_t.sort_option); + match curr_tab.reload_contents(&context.config_t.sort_option) { + Err(e) => return Err(JoshutoError::IO(e)), + _ => {} + } curr_tab.refresh( &view, &context.config_t, |