summaryrefslogtreecommitdiffstats
path: root/src/commands/new_directory.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-04-24 10:36:49 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-04-24 10:36:49 -0400
commit6e95a6600679e6787a56ec5ef2a88fe0fbcf031f (patch)
tree4495e3a2bbb12b96b0b767ab1b844040c7cc4c71 /src/commands/new_directory.rs
parente9a0d00d46ba4955f7d45d12aa412462e3daab39 (diff)
add more error handling
- optimize/cleanup code
Diffstat (limited to 'src/commands/new_directory.rs')
-rw-r--r--src/commands/new_directory.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/commands/new_directory.rs b/src/commands/new_directory.rs
index 64d7e5c..f8df3b1 100644
--- a/src/commands/new_directory.rs
+++ b/src/commands/new_directory.rs
@@ -50,9 +50,12 @@ impl JoshutoRunnable for NewDirectory {
let path = path::PathBuf::from(user_input);
match std::fs::create_dir_all(&path) {
- Ok(_) => ReloadDirList::reload(context, view),
+ Ok(_) => match ReloadDirList::reload(context, view) {
+ Ok(_) => {}
+ Err(e) => return Err(JoshutoError::IO(e)),
+ },
Err(e) => return Err(JoshutoError::IO(e)),
- }
+ };
}
ncurses::doupdate();
Ok(())