diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-03-28 20:41:07 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-03-28 20:41:07 +0000 |
commit | 906af1587144dd4b3caecacdff5ea834012cffa4 (patch) | |
tree | 57ca5b252dcfc76fa79b7a0f41584527b4188cff /src/file_upload.rs | |
parent | Change start message without arguments to be a bit more clear (diff) | |
download | miniserve-906af1587144dd4b3caecacdff5ea834012cffa4.tar.gz miniserve-906af1587144dd4b3caecacdff5ea834012cffa4.zip |
Refuse to start without explicit path if not attached to interactive terminal
Diffstat (limited to 'src/file_upload.rs')
-rw-r--r-- | src/file_upload.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/file_upload.rs b/src/file_upload.rs index 785d72f..93b7109 100644 --- a/src/file_upload.rs +++ b/src/file_upload.rs @@ -20,9 +20,7 @@ fn save_file( overwrite_files: bool, ) -> Pin<Box<dyn Future<Output = Result<i64, ContextualError>>>> { if !overwrite_files && file_path.exists() { - return Box::pin(future::err(ContextualError::CustomError( - "File already exists, and the overwrite_files option has not been set".to_string(), - ))); + return Box::pin(future::err(ContextualError::DuplicateFileError)); } let mut file = match std::fs::File::create(&file_path) { |