Sessions working

This commit is contained in:
2021-05-24 22:49:43 +02:00
parent 2fbb200dd2
commit 1427443caf
5 changed files with 120 additions and 28 deletions

View File

@ -13,6 +13,7 @@ pub enum Kind {
UsimpProtocolError,
Utf8DecodeError,
AuthenticationError,
InvalidSessionError,
}
#[derive(Copy, Clone, Debug)]
@ -64,6 +65,7 @@ impl Error {
Kind::UsimpProtocolError => "USIMP protocol error",
Kind::Utf8DecodeError => "Unable to decode UTF-8 data",
Kind::AuthenticationError => "Unable to authenticate",
Kind::InvalidSessionError => "Invalid session",
},
}
}
@ -95,6 +97,7 @@ impl fmt::Display for Error {
Kind::UsimpProtocolError => "usimp protocol error",
Kind::Utf8DecodeError => "unable to decode utf-8 data",
Kind::AuthenticationError => "unable to authenticate",
Kind::InvalidSessionError => "invalid session",
}
.to_string();
if let Some(desc) = &self.desc {