mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
fmt error for filetransfer
This commit is contained in:
@@ -62,13 +62,9 @@ pub enum FileTransferError {
|
|||||||
//UnknownError,
|
//UnknownError,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FileTransferError {
|
impl std::fmt::Display for FileTransferError {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
/// ### msg
|
let err: String = match self {
|
||||||
///
|
|
||||||
/// Get error message
|
|
||||||
pub fn msg(&self) -> String {
|
|
||||||
match self {
|
|
||||||
FileTransferError::AuthenticationFailed => String::from("Authentication failed: bad credentials"),
|
FileTransferError::AuthenticationFailed => String::from("Authentication failed: bad credentials"),
|
||||||
FileTransferError::BadAddress => String::from("Bad address syntax"),
|
FileTransferError::BadAddress => String::from("Bad address syntax"),
|
||||||
FileTransferError::ConnectionError => String::from("Connection error"),
|
FileTransferError::ConnectionError => String::from("Connection error"),
|
||||||
@@ -80,9 +76,9 @@ impl FileTransferError {
|
|||||||
FileTransferError::ProtocolError => String::from("Protocol error"),
|
FileTransferError::ProtocolError => String::from("Protocol error"),
|
||||||
FileTransferError::UninitializedSession => String::from("Uninitialized session"),
|
FileTransferError::UninitializedSession => String::from("Uninitialized session"),
|
||||||
//FileTransferError::UnknownError => String::from("Unknown error"),
|
//FileTransferError::UnknownError => String::from("Unknown error"),
|
||||||
|
};
|
||||||
|
write!(f, "{}", err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ## FileTransfer
|
/// ## FileTransfer
|
||||||
|
|||||||
Reference in New Issue
Block a user