Changed FileReadonly with Permissionn error
This commit is contained in:
parent
be41314a28
commit
f8be6b7fac
|
@ -62,9 +62,9 @@ pub enum FileTransferErrorType {
|
|||
SslError,
|
||||
DirStatFailed,
|
||||
FileCreateDenied,
|
||||
FileReadonly,
|
||||
IoErr(std::io::Error),
|
||||
NoSuchFileOrDirectory,
|
||||
PexError,
|
||||
ProtocolError,
|
||||
UninitializedSession,
|
||||
UnsupportedFeature,
|
||||
|
@ -101,11 +101,11 @@ impl std::fmt::Display for FileTransferError {
|
|||
FileTransferErrorType::ConnectionError => String::from("Connection error"),
|
||||
FileTransferErrorType::DirStatFailed => String::from("Could not stat directory"),
|
||||
FileTransferErrorType::FileCreateDenied => String::from("Failed to create file"),
|
||||
FileTransferErrorType::FileReadonly => String::from("File is readonly"),
|
||||
FileTransferErrorType::IoErr(err) => format!("IO Error: {}", err),
|
||||
FileTransferErrorType::NoSuchFileOrDirectory => {
|
||||
String::from("No such file or directory")
|
||||
}
|
||||
FileTransferErrorType::PexError => String::from("Not enough permissions"),
|
||||
FileTransferErrorType::ProtocolError => String::from("Protocol error"),
|
||||
FileTransferErrorType::SslError => String::from("SSL error"),
|
||||
FileTransferErrorType::UninitializedSession => String::from("Uninitialized session"),
|
||||
|
|
|
@ -341,7 +341,7 @@ impl FileTransfer for SftpFileTransfer {
|
|||
// Remove file
|
||||
match sftp.unlink(f.abs_path.as_path()) {
|
||||
Ok(_) => Ok(()),
|
||||
Err(err) => Err(FileTransferError::new_ex(FileTransferErrorType::FileReadonly, format!("{}", err))),
|
||||
Err(err) => Err(FileTransferError::new_ex(FileTransferErrorType::PexError, format!("{}", err))),
|
||||
}
|
||||
}
|
||||
FsEntry::Directory(d) => {
|
||||
|
@ -358,7 +358,7 @@ impl FileTransfer for SftpFileTransfer {
|
|||
// Finally remove directory
|
||||
match sftp.rmdir(d.abs_path.as_path()) {
|
||||
Ok(_) => Ok(()),
|
||||
Err(err) => Err(FileTransferError::new_ex(FileTransferErrorType::FileReadonly, format!("{}", err))),
|
||||
Err(err) => Err(FileTransferError::new_ex(FileTransferErrorType::PexError, format!("{}", err))),
|
||||
}
|
||||
}
|
||||
Err(err) => return Err(err),
|
||||
|
|
Loading…
Reference in a new issue