summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 7019aa9..e402010 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -44,6 +44,11 @@ impl Error {
Error::new(raw::LIBSSH2_ERROR_CHANNEL_EOF_SENT, "end of file")
}
+ /// Generate an error for unknown failure
+ pub fn unknown() -> Error {
+ Error::new(libc::c_int::min_value(), "no other error listed")
+ }
+
/// Construct an error from an error code from libssh2
pub fn from_errno(code: libc::c_int) -> Error {
let msg = match code {